summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
0f88bd7)
We do not want people to subclass this class, make sure it is sealed.
Change-Id: I81e8a2ba5232471a8f153a710d957e3cb22bbb5e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
*
* @author Thomas Pantelis
*/
*
* @author Thomas Pantelis
*/
-// Not final and non-sealed for mocking
-public class Snapshot implements Serializable {
+public sealed class Snapshot implements Serializable {
/**
* Implementations of this interface are used as the state payload for a snapshot.
*
/**
* Implementations of this interface are used as the state payload for a snapshot.
*
// Wait for akka's recovery to complete so it doesn't interfere.
mockRaftActor.waitForRecoveryComplete();
// Wait for akka's recovery to complete so it doesn't interfere.
mockRaftActor.waitForRecoveryComplete();
- ApplySnapshot applySnapshot = new ApplySnapshot(mock(Snapshot.class));
+ ApplySnapshot applySnapshot = new ApplySnapshot(
+ Snapshot.create(null, null, 0, 0, 0, 0, 0, persistenceId, null));
doReturn(true).when(mockSupport).handleSnapshotMessage(same(applySnapshot), any(ActorRef.class));
mockRaftActor.handleCommand(applySnapshot);
doReturn(true).when(mockSupport).handleSnapshotMessage(same(applySnapshot), any(ActorRef.class));
mockRaftActor.handleCommand(applySnapshot);