@Test
public void testCreateQuestionGroupForFailureWhenQuestionGroupTitleNotProvided() throws Exception {

    QuestionGroupForm questionGroupForm = getQuestionGroupForm(null, "Create.Client", "Section");
    when(requestContext.getMessageContext()).thenReturn(messageContext);
    String result = questionGroupController.defineQuestionGroup(questionGroupForm, requestContext, true);
    assertThat(result, Is.is(notNullValue()));
    assertThat(result, Is.is("failure"));
    verify(requestContext).getMessageContext();
    verify(messageContext).addMessage(argThat(new MessageMatcher("questionnaire.error.questionGroup.title.empty")));
}