File tree Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ func TestAccessLogListClusterName_Run(t *testing.T) {
72
72
test .VerifyOutputTemplate (t , listTemplate , expected )
73
73
}
74
74
75
+ func TestListTemplate (t * testing.T ) {
76
+ test .VerifyOutputTemplate (t , listTemplate , atlasv2.MongoDBAccessLogsList {})
77
+ }
78
+
75
79
func TestAccessLogListHostname_Run (t * testing.T ) {
76
80
ctrl := gomock .NewController (t )
77
81
mockStore := mocks .NewMockAccessLogsLister (ctrl )
Original file line number Diff line number Diff line change @@ -22,19 +22,20 @@ import (
22
22
"github.com/golang/mock/gomock"
23
23
"github.com/mongodb/mongodb-atlas-cli/internal/flag"
24
24
"github.com/mongodb/mongodb-atlas-cli/internal/mocks"
25
+ "github.com/mongodb/mongodb-atlas-cli/internal/pointer"
25
26
"github.com/mongodb/mongodb-atlas-cli/internal/test"
26
- "go.mongodb.org/atlas/mongodbatlas "
27
+ "go.mongodb.org/atlas-sdk/v20231115002/admin "
27
28
)
28
29
29
30
func TestList_Run (t * testing.T ) {
30
31
ctrl := gomock .NewController (t )
31
32
mockStore := mocks .NewMockClusterLister (ctrl )
32
33
33
- expected := mongodbatlas. AdvancedClustersResponse {
34
- Results : []* mongodbatlas. AdvancedCluster {
34
+ expected := admin. PaginatedAdvancedClusterDescription {
35
+ Results : []admin. AdvancedClusterDescription {
35
36
{
36
- Name : "test" ,
37
- ID : "123" ,
37
+ Name : pointer . Get ( "test" ) ,
38
+ Id : pointer . Get ( "123" ) ,
38
39
},
39
40
},
40
41
}
@@ -54,6 +55,10 @@ func TestList_Run(t *testing.T) {
54
55
}
55
56
}
56
57
58
+ func TestListTemplate (t * testing.T ) {
59
+ test .VerifyOutputTemplate (t , listTemplate , admin.PaginatedAdvancedClusterDescription {})
60
+ }
61
+
57
62
func TestListBuilder (t * testing.T ) {
58
63
test .CmdValidator (
59
64
t ,
Original file line number Diff line number Diff line change @@ -47,9 +47,7 @@ func TestCreate_Run(t *testing.T) {
47
47
CreatePipeline (createOpts .ConfigProjectID (), * request ).Return (expected , nil ).
48
48
Times (1 )
49
49
50
- if err := createOpts .Run (); err != nil {
51
- t .Fatalf ("Run() unexpected error: %v" , err )
52
- }
50
+ require .NoError (t , createOpts .Run ())
53
51
}
54
52
55
53
func TestCreateBuilder (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ const (
41
41
metricsEntity = "metrics"
42
42
searchEntity = "search"
43
43
indexEntity = "index"
44
- datalakeEntity = "datalake"
45
44
datafederationEntity = "datafederation"
46
45
datalakePipelineEntity = "datalakepipeline"
47
46
alertsEntity = "alerts"
You can’t perform that action at this time.
0 commit comments