forked from guidowb/cf-targets-plugin
-
Notifications
You must be signed in to change notification settings - Fork 4
/
fake_auth_token_repo.go
46 lines (35 loc) · 1.5 KB
/
fake_auth_token_repo.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
46
package fakes
import "github.com/cloudfoundry/cli/cf/models"
type FakeAuthTokenRepo struct {
CreatedServiceAuthTokenFields models.ServiceAuthTokenFields
FindAllAuthTokens []models.ServiceAuthTokenFields
FindByLabelAndProviderLabel string
FindByLabelAndProviderProvider string
FindByLabelAndProviderServiceAuthTokenFields models.ServiceAuthTokenFields
FindByLabelAndProviderApiResponse error
UpdatedServiceAuthTokenFields models.ServiceAuthTokenFields
DeletedServiceAuthTokenFields models.ServiceAuthTokenFields
}
func (repo *FakeAuthTokenRepo) Create(authToken models.ServiceAuthTokenFields) (apiErr error) {
repo.CreatedServiceAuthTokenFields = authToken
return
}
func (repo *FakeAuthTokenRepo) FindAll() (authTokens []models.ServiceAuthTokenFields, apiErr error) {
authTokens = repo.FindAllAuthTokens
return
}
func (repo *FakeAuthTokenRepo) FindByLabelAndProvider(label, provider string) (authToken models.ServiceAuthTokenFields, apiErr error) {
repo.FindByLabelAndProviderLabel = label
repo.FindByLabelAndProviderProvider = provider
authToken = repo.FindByLabelAndProviderServiceAuthTokenFields
apiErr = repo.FindByLabelAndProviderApiResponse
return
}
func (repo *FakeAuthTokenRepo) Delete(authToken models.ServiceAuthTokenFields) (apiErr error) {
repo.DeletedServiceAuthTokenFields = authToken
return
}
func (repo *FakeAuthTokenRepo) Update(authToken models.ServiceAuthTokenFields) (apiErr error) {
repo.UpdatedServiceAuthTokenFields = authToken
return
}