summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/api/instancehandler_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/k8splugin/api/instancehandler_test.go')
-rw-r--r--src/k8splugin/api/instancehandler_test.go24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/k8splugin/api/instancehandler_test.go b/src/k8splugin/api/instancehandler_test.go
index 2e2450ed..dac7db00 100644
--- a/src/k8splugin/api/instancehandler_test.go
+++ b/src/k8splugin/api/instancehandler_test.go
@@ -58,6 +58,14 @@ func (m *mockInstanceClient) Get(id string) (app.InstanceResponse, error) {
return m.items[0], nil
}
+func (m *mockInstanceClient) Find(rbName string, ver string, profile string, labelKeys map[string]string) ([]app.InstanceResponse, error) {
+ if m.err != nil {
+ return nil, m.err
+ }
+
+ return m.items, nil
+}
+
func (m *mockInstanceClient) Delete(id string) error {
return m.err
}
@@ -104,14 +112,14 @@ func TestInstanceCreateHandler(t *testing.T) {
"profile-name": "profile1"
}`)),
expected: app.InstanceResponse{
- ID: "HaKpys8e",
+ ID: "HaKpys8e",
Request: app.InstanceRequest{
RBName: "test-rbdef",
RBVersion: "v1",
ProfileName: "profile1",
CloudRegion: "region1",
},
- Namespace: "testnamespace",
+ Namespace: "testnamespace",
Resources: []helm.KubernetesResource{
{
GVK: schema.GroupVersionKind{
@@ -133,14 +141,14 @@ func TestInstanceCreateHandler(t *testing.T) {
instClient: &mockInstanceClient{
items: []app.InstanceResponse{
{
- ID: "HaKpys8e",
+ ID: "HaKpys8e",
Request: app.InstanceRequest{
RBName: "test-rbdef",
RBVersion: "v1",
ProfileName: "profile1",
CloudRegion: "region1",
},
- Namespace: "testnamespace",
+ Namespace: "testnamespace",
Resources: []helm.KubernetesResource{
{
GVK: schema.GroupVersionKind{
@@ -207,14 +215,14 @@ func TestInstanceGetHandler(t *testing.T) {
input: "HaKpys8e",
expectedCode: http.StatusOK,
expectedResponse: &app.InstanceResponse{
- ID: "HaKpys8e",
+ ID: "HaKpys8e",
Request: app.InstanceRequest{
RBName: "test-rbdef",
RBVersion: "v1",
ProfileName: "profile1",
CloudRegion: "region1",
},
- Namespace: "testnamespace",
+ Namespace: "testnamespace",
Resources: []helm.KubernetesResource{
{
GVK: schema.GroupVersionKind{
@@ -235,14 +243,14 @@ func TestInstanceGetHandler(t *testing.T) {
instClient: &mockInstanceClient{
items: []app.InstanceResponse{
{
- ID: "HaKpys8e",
+ ID: "HaKpys8e",
Request: app.InstanceRequest{
RBName: "test-rbdef",
RBVersion: "v1",
ProfileName: "profile1",
CloudRegion: "region1",
},
- Namespace: "testnamespace",
+ Namespace: "testnamespace",
Resources: []helm.KubernetesResource{
{
GVK: schema.GroupVersionKind{