diff options
Diffstat (limited to 'src/ncm/api/clusterhandler_test.go')
-rw-r--r-- | src/ncm/api/clusterhandler_test.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ncm/api/clusterhandler_test.go b/src/ncm/api/clusterhandler_test.go index af5bd160..b32df527 100644 --- a/src/ncm/api/clusterhandler_test.go +++ b/src/ncm/api/clusterhandler_test.go @@ -28,6 +28,7 @@ import ( "testing" moduleLib "github.com/onap/multicloud-k8s/src/ncm/pkg/module" + "github.com/onap/multicloud-k8s/src/orchestrator/pkg/appcontext" pkgerrors "github.com/pkg/errors" ) @@ -41,8 +42,10 @@ type mockClusterManager struct { ClusterProviderItems []moduleLib.ClusterProvider ClusterItems []moduleLib.Cluster ClusterContentItems []moduleLib.ClusterContent + ClusterContextItems []appcontext.AppContext ClusterLabelItems []moduleLib.ClusterLabel ClusterKvPairsItems []moduleLib.ClusterKvPairs + ClusterList []string Err error } @@ -98,6 +101,14 @@ func (m *mockClusterManager) GetClusterContent(provider, name string) (moduleLib return m.ClusterContentItems[0], nil } +func (m *mockClusterManager) GetClusterContext(provider, name string) (appcontext.AppContext, error) { + if m.Err != nil { + return appcontext.AppContext{}, m.Err + } + + return m.ClusterContextItems[0], nil +} + func (m *mockClusterManager) GetClusters(provider string) ([]moduleLib.Cluster, error) { if m.Err != nil { return []moduleLib.Cluster{}, m.Err @@ -106,10 +117,26 @@ func (m *mockClusterManager) GetClusters(provider string) ([]moduleLib.Cluster, return m.ClusterItems, nil } +func (m *mockClusterManager) GetClustersWithLabel(provider, label string) ([]string, error) { + if m.Err != nil { + return []string{}, m.Err + } + + return m.ClusterList, nil +} + func (m *mockClusterManager) DeleteCluster(provider, name string) error { return m.Err } +func (m *mockClusterManager) ApplyNetworkIntents(provider, name string) error { + return m.Err +} + +func (m *mockClusterManager) TerminateNetworkIntents(provider, name string) error { + return m.Err +} + func (m *mockClusterManager) CreateClusterLabel(provider, cluster string, inp moduleLib.ClusterLabel) (moduleLib.ClusterLabel, error) { if m.Err != nil { return moduleLib.ClusterLabel{}, m.Err |