@@ -120,7 +120,21 @@ class MultiServerClusterSpecification extends Specification {
120
120
CLUSTER_LISTENER )
121
121
122
122
when :
123
- sendNotification(secondServer, ReplicaSetOther , [], null ) // null replica set name
123
+ sendNotification(secondServer, ReplicaSetOther , [])
124
+
125
+ then :
126
+ getClusterDescription(cluster). type == ReplicaSet
127
+ getClusterDescription(cluster). all == getServerDescriptions(firstServer, secondServer)
128
+ }
129
+
130
+ def ' should ignore a host without a replica set name when type is replica set' () {
131
+ given :
132
+ def cluster = new MultiServerCluster (
133
+ CLUSTER_ID , ClusterSettings . builder(). requiredClusterType(ReplicaSet ). hosts([firstServer, secondServer]). build(), factory,
134
+ CLUSTER_LISTENER )
135
+
136
+ when :
137
+ sendNotification(secondServer, ReplicaSetOther , [firstServer, secondServer], null ) // null replica set name
124
138
125
139
then :
126
140
getClusterDescription(cluster). type == ReplicaSet
@@ -322,7 +336,7 @@ class MultiServerClusterSpecification extends Specification {
322
336
}
323
337
324
338
def sendNotification (ServerAddress serverAddress , ServerType serverType , List<ServerAddress > hosts ) {
325
- sendNotification(serverAddress, serverType, hosts, null )
339
+ sendNotification(serverAddress, serverType, hosts, ' test ' )
326
340
}
327
341
328
342
def sendNotification (ServerAddress serverAddress , ServerType serverType , List<ServerAddress > hosts , String setName , int setVersion ) {
0 commit comments