@Test
public void testUploadQuestionGroup_UploadFailureDuringValidation() {

    when(requestContext.getMessageContext()).thenReturn(messageContext);
    ValidationException validationException = new ValidationException(GENERIC_VALIDATION);
    validationException.addChildException(new ValidationException(QUESTION_GROUP_TITLE_NOT_PROVIDED));
    validationException.addChildException(new ValidationException(DUPLICATE_QUESTION_FOUND_IN_SECTION));
    doThrow(validationException).when(questionnaireServiceFacade).uploadPPIQuestionGroup("INDIA");
    UploadQuestionGroupForm form = new UploadQuestionGroupForm();
    form.setSelectedCountry("INDIA");
    String result = controller.upload(form, requestContext);
    assertThat(result, is("failure"));
    verify(requestContext).getMessageContext();
    verify(messageContext).addMessage(argThat(new MessageMatcher(QUESTION_GROUP_TITLE_NOT_PROVIDED)));
    verify(messageContext).addMessage(argThat(new MessageMatcher(DUPLICATE_QUESTION_FOUND_IN_SECTION)));
}