diff --git a/internal/cli/atlas/accesslogs/list_test.go b/internal/cli/atlas/accesslogs/list_test.go index 018e0e7e4c..a7135eb812 100644 --- a/internal/cli/atlas/accesslogs/list_test.go +++ b/internal/cli/atlas/accesslogs/list_test.go @@ -72,6 +72,10 @@ func TestAccessLogListClusterName_Run(t *testing.T) { test.VerifyOutputTemplate(t, listTemplate, expected) } +func TestListTemplate(t *testing.T) { + test.VerifyOutputTemplate(t, listTemplate, atlasv2.MongoDBAccessLogsList{}) +} + func TestAccessLogListHostname_Run(t *testing.T) { ctrl := gomock.NewController(t) mockStore := mocks.NewMockAccessLogsLister(ctrl) diff --git a/internal/cli/atlas/clusters/list_test.go b/internal/cli/atlas/clusters/list_test.go index 9aecf9d093..e18f832903 100644 --- a/internal/cli/atlas/clusters/list_test.go +++ b/internal/cli/atlas/clusters/list_test.go @@ -22,19 +22,20 @@ import ( "github.com/golang/mock/gomock" "github.com/mongodb/mongodb-atlas-cli/internal/flag" "github.com/mongodb/mongodb-atlas-cli/internal/mocks" + "github.com/mongodb/mongodb-atlas-cli/internal/pointer" "github.com/mongodb/mongodb-atlas-cli/internal/test" - "go.mongodb.org/atlas/mongodbatlas" + "go.mongodb.org/atlas-sdk/v20231115002/admin" ) func TestList_Run(t *testing.T) { ctrl := gomock.NewController(t) mockStore := mocks.NewMockClusterLister(ctrl) - expected := mongodbatlas.AdvancedClustersResponse{ - Results: []*mongodbatlas.AdvancedCluster{ + expected := admin.PaginatedAdvancedClusterDescription{ + Results: []admin.AdvancedClusterDescription{ { - Name: "test", - ID: "123", + Name: pointer.Get("test"), + Id: pointer.Get("123"), }, }, } @@ -54,6 +55,10 @@ func TestList_Run(t *testing.T) { } } +func TestListTemplate(t *testing.T) { + test.VerifyOutputTemplate(t, listTemplate, admin.PaginatedAdvancedClusterDescription{}) +} + func TestListBuilder(t *testing.T) { test.CmdValidator( t, diff --git a/internal/cli/atlas/datalakepipelines/create_test.go b/internal/cli/atlas/datalakepipelines/create_test.go index 95df2a2c0a..397b2866ab 100644 --- a/internal/cli/atlas/datalakepipelines/create_test.go +++ b/internal/cli/atlas/datalakepipelines/create_test.go @@ -47,9 +47,7 @@ func TestCreate_Run(t *testing.T) { CreatePipeline(createOpts.ConfigProjectID(), *request).Return(expected, nil). Times(1) - if err := createOpts.Run(); err != nil { - t.Fatalf("Run() unexpected error: %v", err) - } + require.NoError(t, createOpts.Run()) } func TestCreateBuilder(t *testing.T) { diff --git a/test/e2e/atlas/helper_test.go b/test/e2e/atlas/helper_test.go index 93d34c21d6..c861d6f10b 100644 --- a/test/e2e/atlas/helper_test.go +++ b/test/e2e/atlas/helper_test.go @@ -41,7 +41,6 @@ const ( metricsEntity = "metrics" searchEntity = "search" indexEntity = "index" - datalakeEntity = "datalake" datafederationEntity = "datafederation" datalakePipelineEntity = "datalakepipeline" alertsEntity = "alerts"