fix: mocks and tests

This commit is contained in:
Fabiennne 2020-10-28 13:53:04 +01:00
parent f47fb07c0f
commit e13f3a0f46
4 changed files with 22 additions and 15 deletions

View file

@ -291,3 +291,7 @@ func (c *ConfClient) AssertAdditionalIdTokenScopes() bool {
func (c *ConfClient) AssertAdditionalAccessTokenScopes() bool { func (c *ConfClient) AssertAdditionalAccessTokenScopes() bool {
return false return false
} }
func (c *ConfClient) IsScopeAllowed(scope string) bool {
return false
}

View file

@ -26,7 +26,7 @@ func NewClientExpectAny(t *testing.T, appType op.ApplicationType) op.Client {
func(id string) string { func(id string) string {
return "login?id=" + id return "login?id=" + id
}) })
m.EXPECT().AllowedScopes().AnyTimes().Return(nil) m.EXPECT().IsScopeAllowed(gomock.Any()).AnyTimes().Return(false)
return c return c
} }

View file

@ -49,20 +49,6 @@ func (mr *MockClientMockRecorder) AccessTokenType() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AccessTokenType", reflect.TypeOf((*MockClient)(nil).AccessTokenType)) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AccessTokenType", reflect.TypeOf((*MockClient)(nil).AccessTokenType))
} }
// AllowedScopes mocks base method
func (m *MockClient) AllowedScopes() []string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AllowedScopes")
ret0, _ := ret[0].([]string)
return ret0
}
// AllowedScopes indicates an expected call of AllowedScopes
func (mr *MockClientMockRecorder) AllowedScopes() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllowedScopes", reflect.TypeOf((*MockClient)(nil).AllowedScopes))
}
// ApplicationType mocks base method // ApplicationType mocks base method
func (m *MockClient) ApplicationType() op.ApplicationType { func (m *MockClient) ApplicationType() op.ApplicationType {
m.ctrl.T.Helper() m.ctrl.T.Helper()
@ -161,6 +147,20 @@ func (mr *MockClientMockRecorder) IDTokenLifetime() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IDTokenLifetime", reflect.TypeOf((*MockClient)(nil).IDTokenLifetime)) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IDTokenLifetime", reflect.TypeOf((*MockClient)(nil).IDTokenLifetime))
} }
// IsScopeAllowed mocks base method
func (m *MockClient) IsScopeAllowed(arg0 string) bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsScopeAllowed", arg0)
ret0, _ := ret[0].(bool)
return ret0
}
// IsScopeAllowed indicates an expected call of IsScopeAllowed
func (mr *MockClientMockRecorder) IsScopeAllowed(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsScopeAllowed", reflect.TypeOf((*MockClient)(nil).IsScopeAllowed), arg0)
}
// LoginURL mocks base method // LoginURL mocks base method
func (m *MockClient) LoginURL(arg0 string) string { func (m *MockClient) LoginURL(arg0 string) string {
m.ctrl.T.Helper() m.ctrl.T.Helper()

View file

@ -177,3 +177,6 @@ func (c *ConfClient) AssertAdditionalIdTokenScopes() bool {
func (c *ConfClient) AssertAdditionalAccessTokenScopes() bool { func (c *ConfClient) AssertAdditionalAccessTokenScopes() bool {
return false return false
} }
func (c *ConfClient) IsScopeAllowed(scope string) bool {
return false
}