@@ -703,7 +703,7 @@ void testAllLeaderInformationChangeEventWithUnknownComponentId() throws Exceptio
703
703
}
704
704
705
705
@ Test
706
- void testHasLeadershipWithLeadershipButNoGrantEventProcessed () throws Exception {
706
+ void testHasLeadershipAsyncWithLeadershipButNoGrantEventProcessed () throws Exception {
707
707
new Context () {
708
708
{
709
709
runTestWithManuallyTriggeredEvents (
@@ -714,10 +714,10 @@ void testHasLeadershipWithLeadershipButNoGrantEventProcessed() throws Exception
714
714
applyToBothContenderContexts (
715
715
ctx -> {
716
716
final CompletableFuture <Boolean > validSessionFuture =
717
- leaderElectionService .hasLeadership (
717
+ leaderElectionService .hasLeadershipAsync (
718
718
ctx .componentId , expectedSessionID );
719
719
final CompletableFuture <Boolean > invalidSessionFuture =
720
- leaderElectionService .hasLeadership (
720
+ leaderElectionService .hasLeadershipAsync (
721
721
ctx .componentId , UUID .randomUUID ());
722
722
executorService .triggerAll ();
723
723
@@ -734,7 +734,7 @@ void testHasLeadershipWithLeadershipButNoGrantEventProcessed() throws Exception
734
734
}
735
735
736
736
@ Test
737
- void testHasLeadershipWithLeadershipAndGrantEventProcessed () throws Exception {
737
+ void testHasLeadershipAsyncWithLeadershipAndGrantEventProcessed () throws Exception {
738
738
new Context () {
739
739
{
740
740
runTestWithManuallyTriggeredEvents (
@@ -753,10 +753,10 @@ void testHasLeadershipWithLeadershipAndGrantEventProcessed() throws Exception {
753
753
.isEqualTo (expectedSessionID );
754
754
755
755
final CompletableFuture <Boolean > validSessionFuture =
756
- leaderElectionService .hasLeadership (
756
+ leaderElectionService .hasLeadershipAsync (
757
757
ctx .componentId , expectedSessionID );
758
758
final CompletableFuture <Boolean > invalidSessionFuture =
759
- leaderElectionService .hasLeadership (
759
+ leaderElectionService .hasLeadershipAsync (
760
760
ctx .componentId , UUID .randomUUID ());
761
761
executorService .triggerAll ();
762
762
@@ -773,7 +773,7 @@ void testHasLeadershipWithLeadershipAndGrantEventProcessed() throws Exception {
773
773
}
774
774
775
775
@ Test
776
- void testHasLeadershipWithLeadershipLostButNoRevokeEventProcessed () throws Exception {
776
+ void testHasLeadershipAsyncWithLeadershipLostButNoRevokeEventProcessed () throws Exception {
777
777
new Context () {
778
778
{
779
779
runTestWithManuallyTriggeredEvents (
@@ -787,10 +787,10 @@ void testHasLeadershipWithLeadershipLostButNoRevokeEventProcessed() throws Excep
787
787
applyToBothContenderContexts (
788
788
ctx -> {
789
789
final CompletableFuture <Boolean > validSessionFuture =
790
- leaderElectionService .hasLeadership (
790
+ leaderElectionService .hasLeadershipAsync (
791
791
ctx .componentId , expectedSessionID );
792
792
final CompletableFuture <Boolean > invalidSessionFuture =
793
- leaderElectionService .hasLeadership (
793
+ leaderElectionService .hasLeadershipAsync (
794
794
ctx .componentId , UUID .randomUUID ());
795
795
796
796
executorService .triggerAll ();
@@ -814,7 +814,7 @@ void testHasLeadershipWithLeadershipLostButNoRevokeEventProcessed() throws Excep
814
814
}
815
815
816
816
@ Test
817
- void testHasLeadershipWithLeadershipLostAndRevokeEventProcessed () throws Exception {
817
+ void testHasLeadershipAsyncWithLeadershipLostAndRevokeEventProcessed () throws Exception {
818
818
new Context () {
819
819
{
820
820
runTestWithSynchronousEventHandling (
@@ -826,12 +826,12 @@ void testHasLeadershipWithLeadershipLostAndRevokeEventProcessed() throws Excepti
826
826
applyToBothContenderContexts (
827
827
ctx -> {
828
828
assertThatFuture (
829
- leaderElectionService .hasLeadership (
829
+ leaderElectionService .hasLeadershipAsync (
830
830
ctx .componentId , expectedSessionID ))
831
831
.eventuallySucceeds ()
832
832
.isEqualTo (false );
833
833
assertThatFuture (
834
- leaderElectionService .hasLeadership (
834
+ leaderElectionService .hasLeadershipAsync (
835
835
ctx .componentId , UUID .randomUUID ()))
836
836
.eventuallySucceeds ()
837
837
.isEqualTo (false );
@@ -842,7 +842,7 @@ void testHasLeadershipWithLeadershipLostAndRevokeEventProcessed() throws Excepti
842
842
}
843
843
844
844
@ Test
845
- void testHasLeadershipAfterLeaderElectionClose () throws Exception {
845
+ void testHasLeadershipAsyncAfterLeaderElectionClose () throws Exception {
846
846
new Context () {
847
847
{
848
848
runTestWithSynchronousEventHandling (
@@ -855,7 +855,7 @@ void testHasLeadershipAfterLeaderElectionClose() throws Exception {
855
855
ctx .leaderElection .close ();
856
856
857
857
assertThatFuture (
858
- leaderElectionService .hasLeadership (
858
+ leaderElectionService .hasLeadershipAsync (
859
859
ctx .componentId , expectedSessionID ))
860
860
.eventuallySucceeds ()
861
861
.isEqualTo (false );
@@ -1061,7 +1061,7 @@ void testOldConfirmLeaderInformationWhileHavingNewLeadership() throws Exception
1061
1061
.hasValue (expectedLeaderInformation );
1062
1062
1063
1063
// Old confirm call should be ignored.
1064
- ctx .leaderElection .confirmLeadership (
1064
+ ctx .leaderElection .confirmLeadershipAsync (
1065
1065
UUID .randomUUID (), ctx .address );
1066
1066
assertThat (
1067
1067
leaderElectionService .getLeaderSessionID (
@@ -1092,7 +1092,7 @@ void testOldConfirmationWhileHavingLeadershipLost() throws Exception {
1092
1092
applyToBothContenderContexts (
1093
1093
ctx -> {
1094
1094
// Old confirm call should be ignored.
1095
- ctx .leaderElection .confirmLeadership (
1095
+ ctx .leaderElection .confirmLeadershipAsync (
1096
1096
currentLeaderSessionId , ctx .address );
1097
1097
1098
1098
assertThat (
@@ -1316,7 +1316,7 @@ void testNestedDeadlockInLeadershipConfirmation() throws Exception {
1316
1316
revocationFuture = CompletableFuture .runAsync (testInstance ::onRevokeLeadership );
1317
1317
contenderLockAcquireLatch .await ();
1318
1318
confirmLeadershipFuture =
1319
- leaderElection .confirmLeadership (leaderSessionId , "random-address" );
1319
+ leaderElection .confirmLeadershipAsync (leaderSessionId , "random-address" );
1320
1320
}
1321
1321
1322
1322
assertThatFuture (revocationFuture ).eventuallySucceeds ();
0 commit comments