@Test public void clusterDescriptionWithAnIncompatibleServerShouldBeIncompatible() throws UnknownHostException { ClusterDescription description = new ClusterDescription( Multiple, Unknown, Arrays.asList( ServerDescription.builder() .state(Connecting) .address(new ServerAddress("loc:27019")) .build(), ServerDescription.builder() .state(Connected) .ok(true) .address(new ServerAddress("loc:27018")) .minWireVersion(MAX_DRIVER_WIRE_VERSION + 1) .maxWireVersion(MAX_DRIVER_WIRE_VERSION + 1) .build(), ServerDescription.builder() .state(Connecting) .address(new ServerAddress("loc:27017")) .build())); assertFalse(description.isCompatibleWithDriver()); }
@Test public void clusterDescriptionWithCompatibleServerShouldBeCompatible() throws UnknownHostException { ClusterDescription description = new ClusterDescription( Multiple, Unknown, Arrays.asList( ServerDescription.builder() .state(Connecting) .address(new ServerAddress("loc:27019")) .build(), ServerDescription.builder() .state(Connecting) .address(new ServerAddress("loc:27018")) .build(), ServerDescription.builder() .state(Connecting) .address(new ServerAddress("loc:27017")) .build())); assertTrue(description.isCompatibleWithDriver()); }