add service
All checks were successful
Deploy Smart Search Backend / deploy (push) Successful in 1m47s
All checks were successful
Deploy Smart Search Backend / deploy (push) Successful in 1m47s
This commit is contained in:
@@ -32,7 +32,7 @@ type AuthServiceMock struct {
|
||||
beforeLogoutCounter uint64
|
||||
LogoutMock mAuthServiceMockLogout
|
||||
|
||||
funcRefresh func(ctx context.Context, refreshToken string) (s1 string, err error)
|
||||
funcRefresh func(ctx context.Context, refreshToken string) (newAccessToken string, newRefreshToken string, err error)
|
||||
funcRefreshOrigin string
|
||||
inspectFuncRefresh func(ctx context.Context, refreshToken string)
|
||||
afterRefreshCounter uint64
|
||||
@@ -899,8 +899,9 @@ type AuthServiceMockRefreshParamPtrs struct {
|
||||
|
||||
// AuthServiceMockRefreshResults contains results of the AuthService.Refresh
|
||||
type AuthServiceMockRefreshResults struct {
|
||||
s1 string
|
||||
err error
|
||||
newAccessToken string
|
||||
newRefreshToken string
|
||||
err error
|
||||
}
|
||||
|
||||
// AuthServiceMockRefreshOrigins contains origins of expectations of the AuthService.Refresh
|
||||
@@ -1003,7 +1004,7 @@ func (mmRefresh *mAuthServiceMockRefresh) Inspect(f func(ctx context.Context, re
|
||||
}
|
||||
|
||||
// Return sets up results that will be returned by AuthService.Refresh
|
||||
func (mmRefresh *mAuthServiceMockRefresh) Return(s1 string, err error) *AuthServiceMock {
|
||||
func (mmRefresh *mAuthServiceMockRefresh) Return(newAccessToken string, newRefreshToken string, err error) *AuthServiceMock {
|
||||
if mmRefresh.mock.funcRefresh != nil {
|
||||
mmRefresh.mock.t.Fatalf("AuthServiceMock.Refresh mock is already set by Set")
|
||||
}
|
||||
@@ -1011,13 +1012,13 @@ func (mmRefresh *mAuthServiceMockRefresh) Return(s1 string, err error) *AuthServ
|
||||
if mmRefresh.defaultExpectation == nil {
|
||||
mmRefresh.defaultExpectation = &AuthServiceMockRefreshExpectation{mock: mmRefresh.mock}
|
||||
}
|
||||
mmRefresh.defaultExpectation.results = &AuthServiceMockRefreshResults{s1, err}
|
||||
mmRefresh.defaultExpectation.results = &AuthServiceMockRefreshResults{newAccessToken, newRefreshToken, err}
|
||||
mmRefresh.defaultExpectation.returnOrigin = minimock.CallerInfo(1)
|
||||
return mmRefresh.mock
|
||||
}
|
||||
|
||||
// Set uses given function f to mock the AuthService.Refresh method
|
||||
func (mmRefresh *mAuthServiceMockRefresh) Set(f func(ctx context.Context, refreshToken string) (s1 string, err error)) *AuthServiceMock {
|
||||
func (mmRefresh *mAuthServiceMockRefresh) Set(f func(ctx context.Context, refreshToken string) (newAccessToken string, newRefreshToken string, err error)) *AuthServiceMock {
|
||||
if mmRefresh.defaultExpectation != nil {
|
||||
mmRefresh.mock.t.Fatalf("Default expectation is already set for the AuthService.Refresh method")
|
||||
}
|
||||
@@ -1048,8 +1049,8 @@ func (mmRefresh *mAuthServiceMockRefresh) When(ctx context.Context, refreshToken
|
||||
}
|
||||
|
||||
// Then sets up AuthService.Refresh return parameters for the expectation previously defined by the When method
|
||||
func (e *AuthServiceMockRefreshExpectation) Then(s1 string, err error) *AuthServiceMock {
|
||||
e.results = &AuthServiceMockRefreshResults{s1, err}
|
||||
func (e *AuthServiceMockRefreshExpectation) Then(newAccessToken string, newRefreshToken string, err error) *AuthServiceMock {
|
||||
e.results = &AuthServiceMockRefreshResults{newAccessToken, newRefreshToken, err}
|
||||
return e.mock
|
||||
}
|
||||
|
||||
@@ -1075,7 +1076,7 @@ func (mmRefresh *mAuthServiceMockRefresh) invocationsDone() bool {
|
||||
}
|
||||
|
||||
// Refresh implements mm_service.AuthService
|
||||
func (mmRefresh *AuthServiceMock) Refresh(ctx context.Context, refreshToken string) (s1 string, err error) {
|
||||
func (mmRefresh *AuthServiceMock) Refresh(ctx context.Context, refreshToken string) (newAccessToken string, newRefreshToken string, err error) {
|
||||
mm_atomic.AddUint64(&mmRefresh.beforeRefreshCounter, 1)
|
||||
defer mm_atomic.AddUint64(&mmRefresh.afterRefreshCounter, 1)
|
||||
|
||||
@@ -1095,7 +1096,7 @@ func (mmRefresh *AuthServiceMock) Refresh(ctx context.Context, refreshToken stri
|
||||
for _, e := range mmRefresh.RefreshMock.expectations {
|
||||
if minimock.Equal(*e.params, mm_params) {
|
||||
mm_atomic.AddUint64(&e.Counter, 1)
|
||||
return e.results.s1, e.results.err
|
||||
return e.results.newAccessToken, e.results.newRefreshToken, e.results.err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1127,7 +1128,7 @@ func (mmRefresh *AuthServiceMock) Refresh(ctx context.Context, refreshToken stri
|
||||
if mm_results == nil {
|
||||
mmRefresh.t.Fatal("No results are set for the AuthServiceMock.Refresh")
|
||||
}
|
||||
return (*mm_results).s1, (*mm_results).err
|
||||
return (*mm_results).newAccessToken, (*mm_results).newRefreshToken, (*mm_results).err
|
||||
}
|
||||
if mmRefresh.funcRefresh != nil {
|
||||
return mmRefresh.funcRefresh(ctx, refreshToken)
|
||||
|
||||
Reference in New Issue
Block a user