public void testMessageParserIncorrectMessageType() throws Exception {
UnprocessedDataMessage badMessage = new UnprocessedDataMessage() {};
try {
importer.parseMessage(badMessage);
fail("Expected an exception, got result");
} catch (MessageParserException e) {
// expected
}
}
Saves me having to define a class that's used for nothing except to make a method fail which makes the test pass :)
I'm sure there are other uses.