@Test
public void testAddQuestionForFailureWhenLessThanTwoChoicesAreGivenForMultiSelect() throws Exception {

    QuestionForm questionForm = new QuestionForm();
    questionForm.getCurrentQuestion().setText("  " + TITLE + "    ");
    questionForm.getCurrentQuestion().setType("multiSelect");
    questionForm.getCurrentQuestion().setCurrentChoice("C1");
    questionForm.getCurrentQuestion().addAnswerChoice();
    when(requestContext.getMessageContext()).thenReturn(messageContext);
    String result = questionController.addQuestion(questionForm, requestContext, true);
    Assert.assertThat(result, is(notNullValue()));
    Assert.assertThat(result, is("failure"));
    Mockito.verify(requestContext).getMessageContext();
    Mockito.verify(messageContext).addMessage(argThat(new MessageMatcher("questionnaire.error.question.choices")));
}