forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_oauthaccesstoken.go
37 lines (29 loc) · 1.23 KB
/
fake_oauthaccesstoken.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
package testclient
import (
ktestclient "k8s.io/kubernetes/pkg/client/unversioned/testclient"
oauthapi "github.com/openshift/origin/pkg/oauth/api"
)
// FakeOAuthAccessTokens implements OAuthAccessTokenInterface. Meant to be embedded into a struct to get a default
// implementation. This makes faking out just the methods you want to test easier.
type FakeOAuthAccessTokens struct {
Fake *Fake
}
func (c *FakeOAuthAccessTokens) Delete(name string) error {
_, err := c.Fake.Invokes(ktestclient.NewRootDeleteAction("oauthaccesstokens", name), &oauthapi.OAuthAccessToken{})
return err
}
func (c *FakeOAuthAccessTokens) Create(inObj *oauthapi.OAuthAccessToken) (*oauthapi.OAuthAccessToken, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootCreateAction("oauthaccesstokens", inObj), inObj)
if obj == nil {
return nil, err
}
return obj.(*oauthapi.OAuthAccessToken), err
}
// Get returns information about a particular image and error if one occurs.
func (c *FakeOAuthAccessTokens) Get(name string) (*oauthapi.OAuthAccessToken, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootGetAction("oauthaccesstokens", name), &oauthapi.OAuthAccessToken{})
if obj == nil {
return nil, err
}
return obj.(*oauthapi.OAuthAccessToken), err
}