use of org.mifos.ui.validation.StubMessageContext in project head by mifos.
the class ValidationExceptionMessageExtractorTest method testBadNumericResponseException.
private void testBadNumericResponseException(BadNumericResponseException e, String expectedMessage) {
ValidationException parent = new ValidationException("Key");
parent.addChildException(e);
ValidationExceptionMessageExtractor extractor = new ValidationExceptionMessageExtractor();
MessageContext context = new StubMessageContext();
extractor.extract(context, parent);
Message[] messages = context.getAllMessages();
Assert.assertEquals(1, messages.length);
Message m = messages[0];
Assert.assertEquals(expectedMessage, m.getText());
}
Aggregations