@Test
public void testAddQuestionForFailureWhenInvalidNumericBoundsGiven() throws Exception {

    QuestionForm questionForm = getQuestionForm(TITLE, "number");
    questionForm.getCurrentQuestion().setNumericMin(100);
    questionForm.getCurrentQuestion().setNumericMax(10);
    questionForm.setValidator(validator);
    when(requestContext.getMessageContext()).thenReturn(messageContext);
    when(messageContext.hasErrorMessages()).thenReturn(false);
    String result = questionController.addQuestion(questionForm, requestContext, true);
    Assert.assertThat(questionForm.getQuestions().size(), is(0));
    Assert.assertThat(result, is("failure"));
    Mockito.verify(requestContext).getMessageContext();
    Mockito.verify(messageContext).addMessage(argThat(new MessageMatcher(QuestionnaireConstants.INVALID_NUMERIC_BOUNDS)));
}