- @Mock
- private static CountDownLatch ready;
-
- private static ShardIdentifier mockShardName = ShardIdentifier.create(Shard.DEFAULT_NAME, MEMBER_1, "config");
-
- private static TestActorRef<MessageCollectorActor> mockShardActor = TestActorRef.create(getSystem(),
- Props.create(MessageCollectorActor.class), mockShardName.toString());
-
- private final DatastoreContext.Builder datastoreContextBuilder = DatastoreContext.newBuilder()
- .dataStoreName(shardMrgIDSuffix).shardInitializationTimeout(600, TimeUnit.MILLISECONDS)
- .shardHeartbeatIntervalInMillis(100).shardElectionTimeoutFactor(6);
-
- private final Collection<ActorSystem> actorSystems = new ArrayList<>();
-
- private final TestActorFactory actorFactory = new TestActorFactory(getSystem());
-
- @Before
- public void setUp() {
- MockitoAnnotations.initMocks(this);
-
- InMemoryJournal.clear();
- InMemorySnapshotStore.clear();
-
- mockShardActor.underlyingActor().clear();
- }
-
- @After
- public void tearDown() {
- InMemoryJournal.clear();
- InMemorySnapshotStore.clear();
-
- for (ActorSystem system: actorSystems) {
- JavaTestKit.shutdownActorSystem(system, null, Boolean.TRUE);
- }
-
- actorFactory.close();