@Test
public void testAddQuestionForEmptyTitle() {

    QuestionGroupForm questionGroupForm = getQuestionGroupForm(TITLE, "Create.Client", "Default");
    questionGroupForm.setValidator(validator);
    questionGroupForm.getCurrentQuestion().setText(null);
    questionGroupForm.getCurrentQuestion().setType("freeText");
    when(messageContext.hasErrorMessages()).thenReturn(true);
    when(requestContext.getMessageContext()).thenReturn(messageContext);
    String result = questionGroupController.addQuestion(questionGroupForm, requestContext);
    assertThat(result, is("failure"));
    verify(requestContext, times(1)).getMessageContext();
    verify(messageContext).addMessage(argThat(new MessageMatcher("NotNull.QuestionGroupForm.currentQuestion.text")));
}