+
+ @Test
+ public void testOnReceiveFindPrimaryForExistentShard() throws Exception {
+
+ new JavaTestKit(system) {{
+ final Props props = ShardManager.props("config");
+ final TestActorRef<ShardManager> subject = TestActorRef.create(system, props);
+
+ // the run() method needs to finish within 3 seconds
+ new Within(duration("1 seconds")) {
+ protected void run() {
+
+ subject.tell(new FindPrimary(Shard.DEFAULT_NAME), getRef());
+
+ expectMsgClass(PrimaryFound.class);
+
+ expectNoMsg();
+ }
+ };
+ }};
+ }