@@ -276,7 +276,7 @@ public void testJoinWithHigherTermElectsLeader() {
276
276
long initialTerm = randomLongBetween (1 , 10 );
277
277
long initialVersion = randomLongBetween (1 , 10 );
278
278
setupFakeMasterServiceAndCoordinator (initialTerm , initialState (node0 , initialTerm , initialVersion ,
279
- new VotingConfiguration ( Collections . singleton (randomFrom (node0 , node1 ). getId () ))));
279
+ VotingConfiguration . of (randomFrom (node0 , node1 ))));
280
280
assertFalse (isLocalNodeElectedMaster ());
281
281
assertNull (coordinator .getStateForMasterService ().nodes ().getMasterNodeId ());
282
282
long newTerm = initialTerm + randomLongBetween (1 , 10 );
@@ -296,7 +296,7 @@ public void testJoinWithHigherTermButBetterStateGetsRejected() {
296
296
long initialTerm = randomLongBetween (1 , 10 );
297
297
long initialVersion = randomLongBetween (1 , 10 );
298
298
setupFakeMasterServiceAndCoordinator (initialTerm , initialState (node0 , initialTerm , initialVersion ,
299
- new VotingConfiguration ( Collections . singleton (node1 . getId ()) )));
299
+ VotingConfiguration . of (node1 )));
300
300
assertFalse (isLocalNodeElectedMaster ());
301
301
long newTerm = initialTerm + randomLongBetween (1 , 10 );
302
302
long higherVersion = initialVersion + randomLongBetween (1 , 10 );
@@ -312,7 +312,7 @@ public void testJoinWithHigherTermButBetterStateStillElectsMasterThroughSelfJoin
312
312
long initialTerm = randomLongBetween (1 , 10 );
313
313
long initialVersion = randomLongBetween (1 , 10 );
314
314
setupFakeMasterServiceAndCoordinator (initialTerm , initialState (node0 , initialTerm , initialVersion ,
315
- new VotingConfiguration ( Collections . singleton (node0 . getId ()) )));
315
+ VotingConfiguration . of (node0 )));
316
316
assertFalse (isLocalNodeElectedMaster ());
317
317
long newTerm = initialTerm + randomLongBetween (1 , 10 );
318
318
long higherVersion = initialVersion + randomLongBetween (1 , 10 );
@@ -326,7 +326,7 @@ public void testJoinElectedLeader() {
326
326
long initialTerm = randomLongBetween (1 , 10 );
327
327
long initialVersion = randomLongBetween (1 , 10 );
328
328
setupFakeMasterServiceAndCoordinator (initialTerm , initialState (node0 , initialTerm , initialVersion ,
329
- new VotingConfiguration ( Collections . singleton (node0 . getId ()) )));
329
+ VotingConfiguration . of (node0 )));
330
330
assertFalse (isLocalNodeElectedMaster ());
331
331
long newTerm = initialTerm + randomLongBetween (1 , 10 );
332
332
joinNodeAndRun (new JoinRequest (node0 , newTerm , Optional .of (new Join (node0 , node0 , newTerm , initialTerm , initialVersion ))));
@@ -343,7 +343,7 @@ public void testJoinElectedLeaderWithHigherTerm() {
343
343
long initialTerm = randomLongBetween (1 , 10 );
344
344
long initialVersion = randomLongBetween (1 , 10 );
345
345
setupFakeMasterServiceAndCoordinator (initialTerm , initialState (node0 , initialTerm , initialVersion ,
346
- new VotingConfiguration ( Collections . singleton (node0 . getId ()) )));
346
+ VotingConfiguration . of (node0 )));
347
347
long newTerm = initialTerm + randomLongBetween (1 , 10 );
348
348
349
349
joinNodeAndRun (new JoinRequest (node0 , newTerm , Optional .of (new Join (node0 , node0 , newTerm , initialTerm , initialVersion ))));
@@ -362,7 +362,7 @@ public void testJoinAccumulation() {
362
362
long initialTerm = randomLongBetween (1 , 10 );
363
363
long initialVersion = randomLongBetween (1 , 10 );
364
364
setupFakeMasterServiceAndCoordinator (initialTerm , initialState (node0 , initialTerm , initialVersion ,
365
- new VotingConfiguration ( Collections . singleton (node2 . getId ()) )));
365
+ VotingConfiguration . of (node2 )));
366
366
assertFalse (isLocalNodeElectedMaster ());
367
367
long newTerm = initialTerm + randomLongBetween (1 , 10 );
368
368
SimpleFuture futNode0 = joinNodeAsync (new JoinRequest (node0 , newTerm , Optional .of (
@@ -389,7 +389,7 @@ public void testJoinFollowerWithHigherTerm() throws Exception {
389
389
long initialTerm = randomLongBetween (1 , 10 );
390
390
long initialVersion = randomLongBetween (1 , 10 );
391
391
setupFakeMasterServiceAndCoordinator (initialTerm , initialState (node0 , initialTerm , initialVersion ,
392
- new VotingConfiguration ( Collections . singleton (node0 . getId ()) )));
392
+ VotingConfiguration . of (node0 )));
393
393
long newTerm = initialTerm + randomLongBetween (1 , 10 );
394
394
handleStartJoinFrom (node1 , newTerm );
395
395
handleFollowerCheckFrom (node1 , newTerm );
@@ -464,7 +464,7 @@ public void testJoinFollowerFails() throws Exception {
464
464
long initialTerm = randomLongBetween (1 , 10 );
465
465
long initialVersion = randomLongBetween (1 , 10 );
466
466
setupFakeMasterServiceAndCoordinator (initialTerm , initialState (node0 , initialTerm , initialVersion ,
467
- new VotingConfiguration ( Collections . singleton (node0 . getId ()) )));
467
+ VotingConfiguration . of (node0 )));
468
468
long newTerm = initialTerm + randomLongBetween (1 , 10 );
469
469
handleStartJoinFrom (node1 , newTerm );
470
470
handleFollowerCheckFrom (node1 , newTerm );
@@ -480,7 +480,7 @@ public void testBecomeFollowerFailsPendingJoin() throws Exception {
480
480
long initialTerm = randomLongBetween (1 , 10 );
481
481
long initialVersion = randomLongBetween (1 , 10 );
482
482
setupFakeMasterServiceAndCoordinator (initialTerm , initialState (node0 , initialTerm , initialVersion ,
483
- new VotingConfiguration ( Collections . singleton (node1 . getId ()) )));
483
+ VotingConfiguration . of (node1 )));
484
484
long newTerm = initialTerm + randomLongBetween (1 , 10 );
485
485
SimpleFuture fut = joinNodeAsync (new JoinRequest (node0 , newTerm ,
486
486
Optional .of (new Join (node0 , node0 , newTerm , initialTerm , initialVersion ))));
0 commit comments