use of com.hazelcast.internal.util.MutableInteger in project hazelcast by hazelcast.
the class ClientClusterDiscoveryServiceTest method test_oneIteration.
@Test
public void test_oneIteration() {
ArrayList<CandidateClusterContext> arrayList = new ArrayList<>();
int numberOfCandidates = 10;
for (int i = 0; i < numberOfCandidates; i++) {
arrayList.add(createContext(i));
}
ClusterDiscoveryService discoveryService = new ClusterDiscoveryService(arrayList, 1, lifecycleService);
MutableInteger count = new MutableInteger();
discoveryService.tryNextCluster((o, o2) -> {
count.value++;
return false;
});
assertEquals(numberOfCandidates, count.value);
}
Aggregations