forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_token_refresher.go
45 lines (38 loc) · 1.28 KB
/
fake_token_refresher.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// This file was generated by counterfeiter
package authenticationfakes
import (
"sync"
"github.com/cloudfoundry/cli/cf/api/authentication"
)
type FakeTokenRefresher struct {
RefreshAuthTokenStub func() (updatedToken string, apiErr error)
refreshAuthTokenMutex sync.RWMutex
refreshAuthTokenArgsForCall []struct{}
refreshAuthTokenReturns struct {
result1 string
result2 error
}
}
func (fake *FakeTokenRefresher) RefreshAuthToken() (updatedToken string, apiErr error) {
fake.refreshAuthTokenMutex.Lock()
fake.refreshAuthTokenArgsForCall = append(fake.refreshAuthTokenArgsForCall, struct{}{})
fake.refreshAuthTokenMutex.Unlock()
if fake.RefreshAuthTokenStub != nil {
return fake.RefreshAuthTokenStub()
} else {
return fake.refreshAuthTokenReturns.result1, fake.refreshAuthTokenReturns.result2
}
}
func (fake *FakeTokenRefresher) RefreshAuthTokenCallCount() int {
fake.refreshAuthTokenMutex.RLock()
defer fake.refreshAuthTokenMutex.RUnlock()
return len(fake.refreshAuthTokenArgsForCall)
}
func (fake *FakeTokenRefresher) RefreshAuthTokenReturns(result1 string, result2 error) {
fake.RefreshAuthTokenStub = nil
fake.refreshAuthTokenReturns = struct {
result1 string
result2 error
}{result1, result2}
}
var _ authentication.TokenRefresher = new(FakeTokenRefresher)