@@ -105,7 +105,8 @@ func TestClusters_ListClusters(t *testing.T) {
105105 },
106106 "srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
107107 "stateName": "IDLE",
108- "versionReleaseSystem": "LTS"
108+ "versionReleaseSystem": "LTS",
109+ "tags": [ { "key": "key1", "value": "value1" } ]
109110 },
110111 {
111112 "autoScaling": {
@@ -181,7 +182,8 @@ func TestClusters_ListClusters(t *testing.T) {
181182 },
182183 "srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
183184 "stateName": "IDLE",
184- "versionReleaseSystem": "LTS"
185+ "versionReleaseSystem": "LTS",
186+ "tags": [ { "key": "key1", "value": "value1" } ]
185187 }
186188 ],
187189 "totalCount": 2
@@ -263,6 +265,12 @@ func TestClusters_ListClusters(t *testing.T) {
263265 SrvAddress : "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017" ,
264266 StateName : "IDLE" ,
265267 VersionReleaseSystem : "LTS" ,
268+ Tags : []* Tag {
269+ {
270+ Key : "key1" ,
271+ Value : "value1" ,
272+ },
273+ },
266274 }
267275
268276 expected := []Cluster {cluster1 , cluster1 }
@@ -391,6 +399,12 @@ func TestClusters_Create(t *testing.T) {
391399 StateName : "IDLE" ,
392400 VersionReleaseSystem : "LTS" ,
393401 RootCertType : "ISRGROOTX1" ,
402+ Tags : []* Tag {
403+ {
404+ Key : "key1" ,
405+ Value : "value1" ,
406+ },
407+ },
394408 }
395409
396410 mux .HandleFunc (fmt .Sprintf ("/api/atlas/v1.0/groups/%s/clusters" , groupID ), func (w http.ResponseWriter , r * http.Request ) {
@@ -444,6 +458,12 @@ func TestClusters_Create(t *testing.T) {
444458 "stateName" : "IDLE" ,
445459 "versionReleaseSystem" : "LTS" ,
446460 "rootCertType" : "ISRGROOTX1" ,
461+ "tags" : []interface {}{
462+ map [string ]interface {}{
463+ "key" : "key1" ,
464+ "value" : "value1" ,
465+ },
466+ },
447467 }
448468
449469 jsonBlob := `
@@ -496,7 +516,10 @@ func TestClusters_Create(t *testing.T) {
496516 },
497517 "srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
498518 "stateName": "IDLE",
499- "versionReleaseSystem": "LTS"
519+ "versionReleaseSystem": "LTS",
520+ "tags": [
521+ { "key": "key1", "value": "value2" }
522+ ]
500523 }
501524 `
502525
@@ -530,6 +553,10 @@ func TestClusters_Create(t *testing.T) {
530553 if pitEnabled := cluster .PitEnabled ; * pitEnabled {
531554 t .Errorf ("expected pitEnabled 'false', received '%t'" , * pitEnabled )
532555 }
556+
557+ if cluster .Tags == nil || len (cluster .Tags ) == 0 {
558+ t .Errorf ("expected tags, received none" )
559+ }
533560}
534561
535562func TestClusters_Update (t * testing.T ) {
0 commit comments