public abstract class JavaTestKit.ExpectMsg<T>
extends java.lang.Object
The received object as transformed by the matching function can be
retrieved with the get
method.
Use this variant to implement more complicated or conditional processing.
final String out = new ExpectMsg<String>("match hint") {
protected String match(Object in) {
if (in instanceof Integer)
return "match";
else
throw noMatch();
}
}.get(); // this extracts the received message
Constructor and Description |
---|
ExpectMsg(scala.concurrent.duration.Duration max,
java.lang.String hint) |
ExpectMsg(java.lang.String hint) |
Modifier and Type | Method and Description |
---|---|
T |
get() |
protected abstract T |
match(java.lang.Object msg) |
protected java.lang.RuntimeException |
noMatch() |