use of org.neo4j.kernel.ha.cluster.HighAvailabilityMemberStateMachine in project neo4j by neo4j.
the class ClusterMetricsTest method getClusterMembers.
private static Supplier<ClusterMembers> getClusterMembers(String memberRole, HighAvailabilityMemberState memberState) {
HighAvailabilityMemberStateMachine stateMachine = mock(HighAvailabilityMemberStateMachine.class);
when(stateMachine.getCurrentState()).thenReturn(memberState);
ClusterMember clusterMember = spy(new ClusterMember(new InstanceId(1)));
when(clusterMember.getHARole()).thenReturn(memberRole);
ObservedClusterMembers observedClusterMembers = mock(ObservedClusterMembers.class);
when(observedClusterMembers.getCurrentMember()).thenReturn(clusterMember);
return () -> new ClusterMembers(observedClusterMembers, stateMachine);
}
Aggregations