use of org.neo4j.causalclustering.core.consensus.RaftMessages.AppendEntries.Response in project neo4j by neo4j.
the class AppendEntriesRequestTest method shouldRejectDiscontinuousEntries.
@Test
public void shouldRejectDiscontinuousEntries() throws Exception {
// given
RaftState state = raftState().myself(myself).build();
long leaderTerm = state.term() + leaderTermDifference;
// when
Outcome outcome = role.handler.handle(appendEntriesRequest().from(leader).leaderTerm(leaderTerm).prevLogIndex(state.entryLog().appendIndex() + 1).prevLogTerm(leaderTerm).logEntry(new RaftLogEntry(leaderTerm, content())).build(), state, log());
// then
Response response = (Response) messageFor(outcome, leader);
assertEquals(state.entryLog().appendIndex(), response.appendIndex());
assertFalse(response.success());
}
Aggregations