Search in sources :

Example 1 with HighAvailabilityMemberStateMachine

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);
}
Also used : ObservedClusterMembers(org.neo4j.kernel.ha.cluster.member.ObservedClusterMembers) HighAvailabilityMemberStateMachine(org.neo4j.kernel.ha.cluster.HighAvailabilityMemberStateMachine) ClusterMember(org.neo4j.kernel.ha.cluster.member.ClusterMember) InstanceId(org.neo4j.cluster.InstanceId) ClusterMembers(org.neo4j.kernel.ha.cluster.member.ClusterMembers) ObservedClusterMembers(org.neo4j.kernel.ha.cluster.member.ObservedClusterMembers)

Aggregations

InstanceId (org.neo4j.cluster.InstanceId)1 HighAvailabilityMemberStateMachine (org.neo4j.kernel.ha.cluster.HighAvailabilityMemberStateMachine)1 ClusterMember (org.neo4j.kernel.ha.cluster.member.ClusterMember)1 ClusterMembers (org.neo4j.kernel.ha.cluster.member.ClusterMembers)1 ObservedClusterMembers (org.neo4j.kernel.ha.cluster.member.ObservedClusterMembers)1