@@ -21,6 +21,7 @@ import (
2121 "testing"
2222
2323 "github.com/go-test/deep"
24+ "github.com/openlyinc/pointy"
2425)
2526
2627func TestGlobalClusters_Get (t * testing.T ) {
@@ -50,7 +51,9 @@ func TestGlobalClusters_Get(t *testing.T) {
5051 "managedNamespaces" : [ {
5152 "collection" : "zips",
5253 "customShardKey" : "city",
53- "db" : "mydata"
54+ "db" : "mydata",
55+ "isCustomShardKeyHashed" : true,
56+ "isShardKeyUnique" : true
5457 },{
5558 "collection" : "stores",
5659 "customShardKey" : "store_number",
@@ -81,9 +84,11 @@ func TestGlobalClusters_Get(t *testing.T) {
8184 },
8285 ManagedNamespaces : []ManagedNamespace {
8386 {
84- Collection : "zips" ,
85- CustomShardKey : "city" ,
86- Db : "mydata" ,
87+ Collection : "zips" ,
88+ CustomShardKey : "city" ,
89+ Db : "mydata" ,
90+ IsCustomShardKeyHashed : pointy .Bool (true ),
91+ IsShardKeyUnique : pointy .Bool (true ),
8792 }, {
8893 Collection : "stores" ,
8994 CustomShardKey : "store_number" ,
@@ -105,16 +110,20 @@ func TestGlobalClusters_AddManagedNamespace(t *testing.T) {
105110 clusterName := "appData"
106111
107112 createRequest := & ManagedNamespace {
108- Db : "mydata" ,
109- Collection : "publishers" ,
110- CustomShardKey : "city" ,
113+ Db : "mydata" ,
114+ Collection : "publishers" ,
115+ CustomShardKey : "city" ,
116+ IsCustomShardKeyHashed : pointy .Bool (true ),
117+ IsShardKeyUnique : pointy .Bool (true ),
111118 }
112119
113120 mux .HandleFunc (fmt .Sprintf ("/api/atlas/v1.0/groups/%s/clusters/%s/globalWrites/managedNamespaces" , groupID , clusterName ), func (w http.ResponseWriter , r * http.Request ) {
114121 expectedRequest := map [string ]interface {}{
115- "db" : "mydata" ,
116- "collection" : "publishers" ,
117- "customShardKey" : "city" ,
122+ "db" : "mydata" ,
123+ "collection" : "publishers" ,
124+ "customShardKey" : "city" ,
125+ "isCustomShardKeyHashed" : true ,
126+ "isShardKeyUnique" : true ,
118127 }
119128
120129 jsonBlob := `
@@ -136,7 +145,9 @@ func TestGlobalClusters_AddManagedNamespace(t *testing.T) {
136145 "managedNamespaces" : [ {
137146 "collection" : "publishers",
138147 "customShardKey" : "city",
139- "db" : "mydata"
148+ "db" : "mydata",
149+ "isCustomShardKeyHashed" : true,
150+ "isShardKeyUnique" : true
140151 },{
141152 "collection" : "stores",
142153 "customShardKey" : "store_number",
0 commit comments