LeaderElectionService { public boolean hasLeader() { return jobNodeStorage.isJobNodeExisted(ElectionNode.LEADER_HOST); } LeaderElectionService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration); void leaderForceElection(); void leaderElection(); Boolean isLeader(); boolean hasLeader(); void removeLeader();  }
@Test public void assertHasLeader() { when(jobNodeStorage.isJobNodeExisted("leader/election/host")).thenReturn(true); assertTrue(leaderElectionService.hasLeader()); }