Created
November 7, 2012 08:24
-
-
Save rkuhn/4030167 to your computer and use it in GitHub Desktop.
JavaTestKit spotlight
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new JavaTestKit(system) {{ | |
final Props props = new Props(SomeActor.class); | |
final ActorRef subject = system.actorOf(props); | |
subject.tell("request", getRef()); | |
expectMsgEquals(duration("1 second"), "response"); | |
new Within(duration("3 seconds")) { | |
protected void run() { | |
subject.tell("hello", getRef()); | |
final String reply = expectMsgClass(String.class); | |
// analyze reply ... | |
expectNoMsg(); | |
} | |
}; | |
}}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment