RaftActorSnapshotMessageSupport { private void onApplySnapshot(ApplySnapshot message) { log.info("{}: Applying snapshot on follower: {}", context.getId(), message.getSnapshot()); context.getSnapshotManager().apply(message); } RaftActorSnapshotMessageSupport(final RaftActorContext context, final RaftActorSnapshotCohort cohort);   }
@Test public void testOnApplySnapshot() { long lastAppliedDuringSnapshotCapture = 1; long lastIndexDuringSnapshotCapture = 2; byte[] snapshotBytes = {1,2,3,4,5}; Snapshot snapshot = Snapshot.create(ByteState.of(snapshotBytes), Collections.<ReplicatedLogEntry>emptyList(), lastIndexDuringSnapshotCapture, 1, lastAppliedDuringSnapshotCapture, 1, -1, null, null); ApplySnapshot applySnapshot = new ApplySnapshot(snapshot); sendMessageToSupport(applySnapshot); verify(mockSnapshotManager).apply(applySnapshot); }