+ @Test(expected=IllegalStateException.class)
+ public void testBatchedModificationsReadyWithIncorrectTotalMessageCount() throws Throwable {
+ new ShardTestKit(getSystem()) {{
+ final TestActorRef<Shard> shard = TestActorRef.create(getSystem(),
+ newShardProps().withDispatcher(Dispatchers.DefaultDispatcherId()),
+ "testBatchedModificationsReadyWithIncorrectTotalMessageCount");
+
+ waitUntilLeader(shard);
+
+ String transactionID = "tx1";
+ BatchedModifications batched = new BatchedModifications(transactionID, DataStoreVersions.CURRENT_VERSION, null);
+ batched.setReady(true);
+ batched.setTotalMessagesSent(2);
+
+ shard.tell(batched, getRef());
+
+ Failure failure = expectMsgClass(duration("5 seconds"), akka.actor.Status.Failure.class);
+
+ shard.tell(PoisonPill.getInstance(), ActorRef.noSender());
+
+ if(failure != null) {
+ throw failure.cause();
+ }
+ }};
+ }
+