github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/cmd/juju/romulus/sla/export_test.go (about) 1 // Copyright 2017 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package sla 5 6 import ( 7 "github.com/juju/romulus/api/sla" 8 9 "github.com/juju/juju/api" 10 "github.com/juju/juju/cmd/modelcmd" 11 ) 12 13 var ( 14 NewAuthorizationClient = &newAuthorizationClient 15 NewSLAClient = &newSLAClient 16 ModelId = &modelId 17 NewJujuClientStore = &newJujuClientStore 18 ) 19 20 // NewSLACommandForTest returns an slaCommand with apis provided by the given arguments 21 func NewSLACommandForTest(apiRoot api.Connection, slaC slaClient, authClient authorizationClient) modelcmd.ModelCommand { 22 cmd := &slaCommand{ 23 newAPIRoot: func() (api.Connection, error) { return apiRoot, nil }, 24 newSLAClient: func(api.Connection) slaClient { return slaC }, 25 newAuthorizationClient: func(options ...sla.ClientOption) (authorizationClient, error) { 26 return authClient, nil 27 }, 28 } 29 return modelcmd.Wrap(cmd) 30 }