@SuppressWarnings({"ThrowableInstanceNeverThrown"})

@Test
public void testCreateQuestionGroupFailureWhenSectionsNotPresent() throws Exception {
    when(requestContext.getMessageContext()).thenReturn(messageContext);
    QuestionGroupForm questionGroupForm = getQuestionGroupForm(TITLE, "Create.Client");
    String result = questionGroupController.defineQuestionGroup(questionGroupForm, requestContext, true);
    assertThat(result, Is.is("failure"));
    verify(requestContext).getMessageContext();
    verify(messageContext).addMessage(argThat(new MessageMatcher("questionnaire.error.section.atLeastOne")));
}