@@ -120,7 +120,21 @@ class MultiServerClusterSpecification extends Specification {
120120 CLUSTER_LISTENER )
121121
122122 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
124138
125139 then :
126140 getClusterDescription(cluster). type == ReplicaSet
@@ -322,7 +336,7 @@ class MultiServerClusterSpecification extends Specification {
322336 }
323337
324338 def sendNotification (ServerAddress serverAddress , ServerType serverType , List<ServerAddress > hosts ) {
325- sendNotification(serverAddress, serverType, hosts, null )
339+ sendNotification(serverAddress, serverType, hosts, ' test ' )
326340 }
327341
328342 def sendNotification (ServerAddress serverAddress , ServerType serverType , List<ServerAddress > hosts , String setName , int setVersion ) {
0 commit comments