@Test
public void testSecureClinicalDocumentsUploadWhenWrongCaptchaIsEnterred() throws Exception {

	MockMultipartFile file = new MockMultipartFile("file", "orig", null, "bar".getBytes());
	doReturn("true").when(sut).scanMultipartFile(file);
	doReturn(false).when(clinicalDocumentService).isDocumentOversized(file);
	doReturn(true).when(clinicalDocumentService).isDocumentExtensionPermitted(file);
	doReturn(false).when(recaptchaUtil).checkAnswer(anyString(), anyString(), anyString());
	mockMvc.perform(fileUpload("/patients/clinicaldocuments.html").file(file)
			.param("name", "mocked_name")
			.param("description", "mocked_description")
			.param("documentType", "mocked_type"))
		.andExpect(view().name("redirect:/patients/clinicaldocuments.html?notify=wrong_captcha"));
}