diff options
Diffstat (limited to 'src/clm/api/clusterhandler_test.go')
-rw-r--r-- | src/clm/api/clusterhandler_test.go | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/clm/api/clusterhandler_test.go b/src/clm/api/clusterhandler_test.go index 7095e87c..a866835b 100644 --- a/src/clm/api/clusterhandler_test.go +++ b/src/clm/api/clusterhandler_test.go @@ -28,8 +28,8 @@ import ( "testing" "github.com/onap/multicloud-k8s/src/clm/pkg/cluster" - "github.com/onap/multicloud-k8s/src/orchestrator/pkg/appcontext" types "github.com/onap/multicloud-k8s/src/orchestrator/pkg/module/types" + "github.com/onap/multicloud-k8s/src/orchestrator/pkg/state" pkgerrors "github.com/pkg/errors" ) @@ -43,7 +43,7 @@ type mockClusterManager struct { ClusterProviderItems []cluster.ClusterProvider ClusterItems []cluster.Cluster ClusterContentItems []cluster.ClusterContent - ClusterContextItems []appcontext.AppContext + ClusterStateInfo []state.StateInfo ClusterLabelItems []cluster.ClusterLabel ClusterKvPairsItems []cluster.ClusterKvPairs ClusterList []string @@ -102,12 +102,12 @@ func (m *mockClusterManager) GetClusterContent(provider, name string) (cluster.C return m.ClusterContentItems[0], nil } -func (m *mockClusterManager) GetClusterContext(provider, name string) (appcontext.AppContext, error) { +func (m *mockClusterManager) GetClusterState(provider, name string) (state.StateInfo, error) { if m.Err != nil { - return appcontext.AppContext{}, m.Err + return state.StateInfo{}, m.Err } - return m.ClusterContextItems[0], nil + return m.ClusterStateInfo[0], nil } func (m *mockClusterManager) GetClusters(provider string) ([]cluster.Cluster, error) { @@ -186,6 +186,12 @@ func (m *mockClusterManager) DeleteClusterKvPairs(provider, clusterName, kvpair return m.Err } +func init() { + cpJSONFile = "../json-schemas/metadata.json" + ckvJSONFile = "../json-schemas/cluster-kv.json" + clJSONFile = "../json-schemas/cluster-label.json" +} + func TestClusterProviderCreateHandler(t *testing.T) { testCases := []struct { label string |