-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Expand file tree
/
Copy pathfake_useridentitymappings.go
More file actions
49 lines (38 loc) · 1.74 KB
/
fake_useridentitymappings.go
File metadata and controls
49 lines (38 loc) · 1.74 KB
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
47
48
49
package testclient
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
clientgotesting "k8s.io/client-go/testing"
userapi "github.com/openshift/origin/pkg/user/api"
)
// FakeUserIdentityMappings implements UserIdentityMappingInterface. 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 FakeUserIdentityMappings struct {
Fake *Fake
}
var userIdentityMappingsResource = schema.GroupVersionResource{Group: "", Version: "", Resource: "useridentitymappings"}
func (c *FakeUserIdentityMappings) Get(name string, options metav1.GetOptions) (*userapi.UserIdentityMapping, error) {
obj, err := c.Fake.Invokes(clientgotesting.NewRootGetAction(userIdentityMappingsResource, name), &userapi.UserIdentityMapping{})
if obj == nil {
return nil, err
}
return obj.(*userapi.UserIdentityMapping), err
}
func (c *FakeUserIdentityMappings) Create(inObj *userapi.UserIdentityMapping) (*userapi.UserIdentityMapping, error) {
obj, err := c.Fake.Invokes(clientgotesting.NewRootCreateAction(userIdentityMappingsResource, inObj), inObj)
if obj == nil {
return nil, err
}
return obj.(*userapi.UserIdentityMapping), err
}
func (c *FakeUserIdentityMappings) Update(inObj *userapi.UserIdentityMapping) (*userapi.UserIdentityMapping, error) {
obj, err := c.Fake.Invokes(clientgotesting.NewRootUpdateAction(userIdentityMappingsResource, inObj), inObj)
if obj == nil {
return nil, err
}
return obj.(*userapi.UserIdentityMapping), err
}
func (c *FakeUserIdentityMappings) Delete(name string) error {
_, err := c.Fake.Invokes(clientgotesting.NewRootDeleteAction(userIdentityMappingsResource, name), &userapi.UserIdentityMapping{})
return err
}