use of org.neo4j.cluster.protocol.election.ElectionCredentialsProvider in project neo4j by neo4j.
the class MultiPaxosContextTest method shouldDeepClone.
@Test
public void shouldDeepClone() throws Exception {
// Given
ObjectStreamFactory objStream = new ObjectStreamFactory();
AcceptorInstanceStore acceptorInstances = mock(AcceptorInstanceStore.class);
Executor executor = mock(Executor.class);
Timeouts timeouts = mock(Timeouts.class);
ClusterConfiguration clusterConfig = new ClusterConfiguration("myCluster", NullLogProvider.getInstance());
ElectionCredentialsProvider electionCredentials = mock(ElectionCredentialsProvider.class);
Config config = mock(Config.class);
when(config.get(ClusterSettings.max_acceptors)).thenReturn(10);
MultiPaxosContext ctx = new MultiPaxosContext(new InstanceId(1), Collections.<ElectionRole>emptyList(), clusterConfig, executor, NullLogProvider.getInstance(), objStream, objStream, acceptorInstances, timeouts, electionCredentials, config);
// When
MultiPaxosContext snapshot = ctx.snapshot(NullLogProvider.getInstance(), timeouts, executor, acceptorInstances, objStream, objStream, electionCredentials);
// Then
assertEquals(ctx, snapshot);
}
Aggregations