- setLastLogEntry((MockRaftActorContext) context, 0, 0, "");
+ setLastLogEntry((MockRaftActorContext) context, 0, 0, new MockRaftActorContext.MockPayload(""));
List<ReplicatedLogEntry> entries =
Arrays.asList(
(ReplicatedLogEntry) new MockRaftActorContext.MockReplicatedLogEntry(100, 101,
List<ReplicatedLogEntry> entries =
Arrays.asList(
(ReplicatedLogEntry) new MockRaftActorContext.MockReplicatedLogEntry(100, 101,
// Set the last log entry term for the receiver to be greater than
// what we will be sending as the prevLogTerm in AppendEntries
MockRaftActorContext.SimpleReplicatedLog mockReplicatedLog =
// Set the last log entry term for the receiver to be greater than
// what we will be sending as the prevLogTerm in AppendEntries
MockRaftActorContext.SimpleReplicatedLog mockReplicatedLog =
- setLastLogEntry(context, 20, 0, "");
+ setLastLogEntry(context, 20, 0, new MockRaftActorContext.MockPayload(""));
// AppendEntries is now sent with a bigger term
// this will set the receivers term to be the same as the sender's term
// AppendEntries is now sent with a bigger term
// this will set the receivers term to be the same as the sender's term
context.setReplicatedLog(log);
// Prepare the entries to be sent with AppendEntries
List<ReplicatedLogEntry> entries = new ArrayList<>();
entries.add(
context.setReplicatedLog(log);
// Prepare the entries to be sent with AppendEntries
List<ReplicatedLogEntry> entries = new ArrayList<>();
entries.add(
// Send appendEntries with the same term as was set on the receiver
// before the new behavior was created (1 in this case)
// Send appendEntries with the same term as was set on the receiver
// before the new behavior was created (1 in this case)
context.setReplicatedLog(log);
// Prepare the entries to be sent with AppendEntries
List<ReplicatedLogEntry> entries = new ArrayList<>();
entries.add(
context.setReplicatedLog(log);
// Prepare the entries to be sent with AppendEntries
List<ReplicatedLogEntry> entries = new ArrayList<>();
entries.add(
// Send appendEntries with the same term as was set on the receiver
// before the new behavior was created (1 in this case)
// Send appendEntries with the same term as was set on the receiver
// before the new behavior was created (1 in this case)
assertEquals(4, log.last().getIndex() + 1);
assertNotNull(log.get(2));
assertEquals(4, log.last().getIndex() + 1);
assertNotNull(log.get(2));
- assertEquals("two-1", log.get(2).getData());
+ assertEquals("two-1", log.get(2).getData().toString());
+
+ assertEquals("three", log.get(3).getData().toString());