Skip to content

Commit 60f7536

Browse files
committed
correct wrong type test
1 parent 769bc87 commit 60f7536

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pkg/client/fake/client_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,22 +1976,23 @@ var _ = Describe("Fake client", func() {
19761976
sa := &corev1.ServiceAccount{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
19771977
cl := NewClientBuilder().Build()
19781978

1979-
tokenRequest := &authenticationv1.TokenRequest{}
1980-
err := cl.SubResource("token").Create(context.Background(), sa, tokenRequest)
1979+
err := cl.SubResource("token").Create(context.Background(), sa, &authenticationv1.TokenRequest{})
19811980
Expect(err).To(HaveOccurred())
19821981
Expect(apierrors.IsNotFound(err)).To(BeTrue())
19831982
})
19841983

19851984
It("should error when creating a token with the wrong subresource type", func() {
19861985
cl := NewClientBuilder().Build()
19871986
err := cl.SubResource("token").Create(context.Background(), &corev1.ServiceAccount{}, &corev1.Namespace{})
1987+
Expect(err).To(HaveOccurred())
19881988
Expect(apierrors.IsBadRequest(err)).To(BeTrue())
19891989
})
19901990

19911991
It("should error when creating a token with the wrong type", func() {
19921992
cl := NewClientBuilder().Build()
1993-
err := cl.SubResource("token").Create(context.Background(), &corev1.Secret{}, &corev1.Namespace{})
1994-
Expect(apierrors.IsBadRequest(err)).To(BeTrue())
1993+
err := cl.SubResource("token").Create(context.Background(), &corev1.Secret{}, &authenticationv1.TokenRequest{})
1994+
Expect(err).To(HaveOccurred())
1995+
Expect(apierrors.IsNotFound(err)).To(BeTrue())
19951996
})
19961997

19971998
It("should leave typemeta empty on typed get", func() {

0 commit comments

Comments
 (0)