I have an Actor, which publish different kind of messages at different events and junit has been written for that using TestKit.
I want to consume message with "specific word" only and skip the rest. Below code consumes all the message but I want to check all and only consume message with specific word, rest to ignore.
while (testKit.msgAvailable()) {
testKit.expectMsgClass(Message.class);
}
How I may do? I could see a method "fishForSpecificMessage()" but not getting how I could do compare the string at Function parameter or provide the implementation for it.
Please help with some example.