/** Test assertContainsMessage(). */
@Test public void testAssertContainsMessage() {
ValidationErrors details1 = new ValidationErrors();
details1.addMessage("key1", null);
InvalidDataException e1 = new InvalidDataException("message1", details1);
ValidationErrors details2 = new ValidationErrors();
details2.addMessage("key2", "context2", null);
InvalidDataException e2 = new InvalidDataException("message2", details2);
ValidationErrors details3 = new ValidationErrors();
details3.addMessage("key3a", "context3a", null);
details3.addMessage("key3b", null);
InvalidDataException e3 = new InvalidDataException("message3", details3);
assertContainsMessage(e1, "key1");
assertContainsMessage(e1, "key1", null);
assertContainsMessage(e2, "key2", "context2");
assertContainsMessage(e3, "key3b");