diff --git a/pkg/svcat/service-catalog/class_test.go b/pkg/svcat/service-catalog/class_test.go index f04a6ceddbd..41f505ca404 100644 --- a/pkg/svcat/service-catalog/class_test.go +++ b/pkg/svcat/service-catalog/class_test.go @@ -38,11 +38,13 @@ var _ = Describe("Class", func() { svcCatClient *fake.Clientset sc *v1beta1.ClusterServiceClass sc2 *v1beta1.ClusterServiceClass + sc3 *v1beta1.ClusterServiceClass ) BeforeEach(func() { sc = &v1beta1.ClusterServiceClass{ObjectMeta: metav1.ObjectMeta{Name: "foobar"}} sc2 = &v1beta1.ClusterServiceClass{ObjectMeta: metav1.ObjectMeta{Name: "barbaz"}} + sc3 = &v1beta1.ClusterServiceClass{ObjectMeta: metav1.ObjectMeta{Name: "fromclass"}} svcCatClient = fake.NewSimpleClientset(sc, sc2) sdk = &SDK{ ServiceCatalogClient: svcCatClient, @@ -210,16 +212,15 @@ var _ = Describe("Class", func() { Describe("CreateClass", func() { It("Calls the generated v1beta1 create method with the passed in class", func() { className := "newclass" - nc := &v1beta1.ClusterServiceClass{ObjectMeta: metav1.ObjectMeta{Name: className}} - - class, err := sdk.CreateClass(nc) + sc3.Spec.ExternalName = className + class, err := sdk.CreateClass(sc3) Expect(err).NotTo(HaveOccurred()) - Expect(class).To(Equal(nc)) + Expect(class).To(Equal(sc3)) actions := svcCatClient.Actions() Expect(actions[0].Matches("create", "clusterserviceclasses")).To(BeTrue()) objectFromRequest := actions[0].(testing.CreateActionImpl).Object.(*v1beta1.ClusterServiceClass) - Expect(objectFromRequest.ObjectMeta.Name).To(Equal(className)) + Expect(objectFromRequest.Spec.ExternalName).To(Equal(className)) }) It("Bubbles up errors", func() { class, err := sdk.CreateClass(sc)