@Test
public void testDoGetShouldSendErrorResponseWhenFileParsingFailed() throws ServletException, IOException, FileUploadException {

    //GIVEN
    List<FileItem> uploadedFiles = new ArrayList<>();
    given(request.getMethod()).willReturn("POST");
    given(servletFileUpload.parseRequest(request)).willReturn(uploadedFiles);
    given(multiPartFileParser.parseMultiPartFiles(uploadedFiles)).willThrow(new CannotUploadExternalResourceException("", null));
    //WHEN
    underTest.doGet(request, response);
    //THEN
    verify(response).setContentType("text/html");
    verify(response).setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    verify(printWriter).write(Matchers.anyString());
}