use of io.aeron.cluster.client.RecordingLog in project aeron by real-logic.
the class RecordingLogTest method shouldAppendAndThenCommitTermPosition.
@Test
public void shouldAppendAndThenCommitTermPosition() {
final RecordingLog recordingLog = new RecordingLog(TEMP_DIR);
final long leadershipTermId = 1111L;
final long termBaseLogPosition = 2222L;
final long timestamp = 3333L;
final int votedForMemberId = 1;
recordingLog.appendTerm(leadershipTermId, termBaseLogPosition, timestamp, votedForMemberId);
final long newPosition = 9999L;
recordingLog.commitLeadershipTermPosition(leadershipTermId, newPosition);
final RecordingLog recordingLogTwo = new RecordingLog(TEMP_DIR);
assertThat(recordingLogTwo.entries().size(), is(1));
final RecordingLog.Entry actualEntry = recordingLogTwo.entries().get(0);
assertEquals(newPosition, actualEntry.termPosition);
}
Aggregations