@SuppressWarnings({"ThrowableInstanceNeverThrown"})

@Test
public void testSaveQuestionnaireFailureForNumericResponseLessThanMinBound() {
    ValidationException validationException = new ValidationException(GENERIC_VALIDATION);
    validationException.addChildException(new BadNumericResponseException("q1", 10, null));
    doThrow(validationException).when(questionnaireServiceFacade).saveResponses(Mockito.<QuestionGroupDetails>any());
    when(requestContext.getMessageContext()).thenReturn(messageContext);
    String result = questionGroupController.saveQuestionnaire(getQuestionGroupDetails(), 1, requestContext);
    assertThat(result, is("failure"));
    verify(requestContext, times(1)).getMessageContext();
    verify(messageContext).addMessage(argThat(new MessageMatcher("questionnaire.invalid.numeric.min.response")));
}