@Test
public void testAddQuestionForFailureWhenQuestionTitleProvidedWithAllBlanks() throws Exception {

    QuestionForm qform = new QuestionForm();
    qform.setValidator(validator);
    qform.getCurrentQuestion().setText("   ");
    qform.getCurrentQuestion().setType("freeText");
    when(requestContext.getMessageContext()).thenReturn(messageContext);
    when(messageContext.hasErrorMessages()).thenReturn(true);
    String result = questionController.addQuestion(qform, requestContext, true);
    Assert.assertThat(qform.getQuestions().size(), is(0));
    Assert.assertThat(result, is(notNullValue()));
    Assert.assertThat(result, is("failure"));
    Mockito.verify(requestContext).getMessageContext();
    // TODO: Assert for message code content
    Mockito.verify(messageContext).addMessage(argThat(new MessageMatcher("Pattern.QuestionForm.currentQuestion.text")));
    //verify(messageContext).addMessage(argThat(new MessageMatcher("NotNull.QuestionForm.currentQuestion.type")));
}