Skip to content

Commit b00cc56

Browse files
Added API Tests
1 parent cd8a6de commit b00cc56

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

pkg/quarkus/v1alpha/api_test.go

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package v1
1616

1717
import (
18-
"fmt"
1918
. "github.com/onsi/ginkgo"
2019
. "github.com/onsi/gomega"
2120
"github.com/spf13/pflag"
@@ -36,15 +35,27 @@ var _ = Describe("v1", func() {
3635
}
3736

3837
Describe("UpdateResource", func() {
39-
testAPIOptions := &createAPIOptions{}
40-
testAPIOptions.UpdateResource(&testResource)
38+
testAPIOptions := &createAPIOptions{
39+
CRDVersion: "testVersion",
40+
Namespaced: true,
41+
}
42+
updateTestResource := resource.Resource{}
43+
testAPIOptions.UpdateResource(&updateTestResource)
44+
45+
It("verify that resource API's CRDVersion was set", func() {
46+
Expect(updateTestResource.API.CRDVersion, testAPIOptions.CRDVersion)
47+
})
48+
49+
It("verify that resource API's Namespaced was set", func() {
50+
Expect(updateTestResource.API.Namespaced, testAPIOptions.Namespaced)
51+
})
4152

4253
It("verify that resource path is an empty string", func() {
43-
Expect(testResource.Path, "")
54+
Expect(updateTestResource.Path, "")
4455
})
4556

4657
It("verify that resource controller is false", func() {
47-
Expect(testResource.Controller).To(BeFalse())
58+
Expect(updateTestResource.Controller).To(BeFalse())
4859
})
4960
})
5061

@@ -79,9 +90,8 @@ var _ = Describe("v1", func() {
7990
})
8091

8192
Describe("Run", func() {
82-
testFileSystem := machinery.Filesystem{}
8393
It("should return nil", func() {
84-
Expect(testAPISubcommand.Run(testFileSystem)).To(BeNil())
94+
Expect(testAPISubcommand.Run(machinery.Filesystem{})).To(BeNil())
8595
})
8696
})
8797

@@ -115,7 +125,6 @@ var _ = Describe("v1", func() {
115125
})
116126

117127
It("should error by group name", func() {
118-
fmt.Println()
119128
Expect(groupErr).To(HaveOccurred())
120129
})
121130

0 commit comments

Comments
 (0)