// #crTest @Test public void countVotesAsIntendedNotAsInFlorida() { ActorRef routedActor = system.actorOf(new Props().withRouter(new VoteCountRouter())); routedActor.tell(DemocratVote); routedActor.tell(DemocratVote); routedActor.tell(RepublicanVote); routedActor.tell(DemocratVote); routedActor.tell(RepublicanVote); Timeout timeout = new Timeout(Duration.parse("1 seconds")); Future<Object> democratsResult = routedActor.ask(DemocratCountResult, timeout); Future<Object> republicansResult = routedActor.ask(RepublicanCountResult, timeout); assertEquals(3, Await.result(democratsResult, timeout.duration())); assertEquals(2, Await.result(republicansResult, timeout.duration())); }
@After public void tearDown() { system.shutdown(); }
@Before public void setUp() { system = ActorSystem.create("MySystem", AkkaSpec.testConf()); }