diff --git a/api/connector/simpleconnector_test.go b/api/connector/simpleconnector_test.go index 5fa1a7a9ce1..4ca120f41e1 100644 --- a/api/connector/simpleconnector_test.go +++ b/api/connector/simpleconnector_test.go @@ -59,7 +59,7 @@ func (s *simpleConnectorSuite) TestNewSimpleRespectsClientCredentials(c *gc.C) { }, }, { - name: "with username/password and client credentials; username/password takes over", + name: "with both username and client ID", opts: SimpleConfig{ ControllerAddresses: []string{"some.host:9999"}, ModelUUID: "some-uuid", @@ -68,17 +68,15 @@ func (s *simpleConnectorSuite) TestNewSimpleRespectsClientCredentials(c *gc.C) { ClientID: "some-client-id", ClientSecret: "some-client-secret", }, - expectedAPIInfo: api.Info{ - Addrs: []string{"some.host:9999"}, - ModelTag: names.NewModelTag("some-uuid"), - Tag: names.NewUserTag("some-username"), - Password: "some-password", - }, - expectedDefaultDialOpts: func() api.DialOpts { - expected := api.DefaultDialOpts() - expected.LoginProvider = api.NewClientCredentialsLoginProvider("some-client-id", "some-client-secret") - return expected + expectedError: "only one of Username or ClientID should be set", + }, + { + name: "with neither username nor client ID", + opts: SimpleConfig{ + ControllerAddresses: []string{"some.host:9999"}, + ModelUUID: "some-uuid", }, + expectedError: "one of Username or ClientID must be set", }, }