state = new ArrayList<>();
this.actorDelegate = mock(RaftActor.class);
this.recoveryCohortDelegate = mock(RaftActorRecoveryCohort.class);
- this.snapshotCohortDelegate = mock(RaftActorSnapshotCohort.class);
+
+ this.snapshotCohortDelegate = builder.snapshotCohort != null ? builder.snapshotCohort :
+ mock(RaftActorSnapshotCohort.class);
if(builder.dataPersistenceProvider == null){
setPersistence(builder.persistent.isPresent() ? builder.persistent.get() : true);
private Optional<Boolean> persistent = Optional.absent();
private final Class<A> actorClass;
private Function<Runnable, Void> pauseLeaderFunction;
+ private RaftActorSnapshotCohort snapshotCohort;
protected AbstractBuilder(Class<A> actorClass) {
this.actorClass = actorClass;
return self();
}
+ public T snapshotCohort(RaftActorSnapshotCohort snapshotCohort) {
+ this.snapshotCohort = snapshotCohort;
+ return self();
+ }
+
public Props props() {
return Props.create(actorClass, this);
}