@@ -21,36 +21,37 @@ import (
21
21
"time"
22
22
23
23
"k8s.io/apiserver/pkg/admission"
24
+
24
25
"github.com/programming-kubernetes/custom-apiserver/pkg/admission/custominitializer"
25
- "github.com/programming-kubernetes/custom-apiserver/pkg/generated/clientset/internalversion /fake"
26
- informers "github.com/programming-kubernetes/custom-apiserver/pkg/generated/informers/internalversion "
26
+ "github.com/programming-kubernetes/custom-apiserver/pkg/generated/clientset/versioned /fake"
27
+ informers "github.com/programming-kubernetes/custom-apiserver/pkg/generated/informers/externalversions "
27
28
)
28
29
29
30
// TestWantsInternalRestaurantInformerFactory ensures that the informer factory is injected
30
- // when the WantsInternalRestaurantInformerFactory interface is implemented by a plugin.
31
+ // when the WantsRestaurantInformerFactory interface is implemented by a plugin.
31
32
func TestWantsInternalRestaurantInformerFactory (t * testing.T ) {
32
33
cs := & fake.Clientset {}
33
34
sf := informers .NewSharedInformerFactory (cs , time .Duration (1 )* time .Second )
34
35
target := custominitializer .New (sf )
35
36
36
- wantRestaurantInformerFactory := & wantInternalRestaurantInformerFactory {}
37
+ wantRestaurantInformerFactory := & wantRestaurantInformerFactory {}
37
38
target .Initialize (wantRestaurantInformerFactory )
38
39
if wantRestaurantInformerFactory .sf != sf {
39
40
t .Errorf ("expected informer factory to be initialized" )
40
41
}
41
42
}
42
43
43
- // wantInternalRestaurantInformerFactory is a test stub that fulfills the WantsInternalRestaurantInformerFactory interface
44
- type wantInternalRestaurantInformerFactory struct {
44
+ // wantRestaurantInformerFactory is a test stub that fulfills the WantsRestaurantInformerFactory interface
45
+ type wantRestaurantInformerFactory struct {
45
46
sf informers.SharedInformerFactory
46
47
}
47
48
48
- func (self * wantInternalRestaurantInformerFactory ) SetInternalRestaurantInformerFactory (sf informers.SharedInformerFactory ) {
49
+ func (self * wantRestaurantInformerFactory ) SetRestaurantInformerFactory (sf informers.SharedInformerFactory ) {
49
50
self .sf = sf
50
51
}
51
- func (self * wantInternalRestaurantInformerFactory ) Admit (a admission.Attributes ) error { return nil }
52
- func (self * wantInternalRestaurantInformerFactory ) Handles (o admission.Operation ) bool { return false }
53
- func (self * wantInternalRestaurantInformerFactory ) ValidateInitialization () error { return nil }
52
+ func (self * wantRestaurantInformerFactory ) Admit (a admission.Attributes ) error { return nil }
53
+ func (self * wantRestaurantInformerFactory ) Handles (o admission.Operation ) bool { return false }
54
+ func (self * wantRestaurantInformerFactory ) ValidateInitialization () error { return nil }
54
55
55
- var _ admission.Interface = & wantInternalRestaurantInformerFactory {}
56
- var _ custominitializer.WantsInternalRestaurantInformerFactory = & wantInternalRestaurantInformerFactory {}
56
+ var _ admission.Interface = & wantRestaurantInformerFactory {}
57
+ var _ custominitializer.WantsRestaurantInformerFactory = & wantRestaurantInformerFactory {}
0 commit comments