Source:
<code>protected void testExecute() throws Exception { gaeSimulation.logoutUser(); ______TS("Normal case: valid report with all fields populated"); ErrorReportRequest report = new ErrorReportRequest(REQUEST_ID, SUBJECT, CONTENT); SendErrorReportAction action = getAction(report, PARAMS); JsonResult jsonResult = getJsonResult(action); String expectedLogMessage = "====== USER FEEDBACK ABOUT ERROR ======" + System.lineSeparator() + "USER: Non-logged in user" + System.lineSeparator() + "REQUEST ID: " + REQUEST_ID + System.lineSeparator() + "SUBJECT: " + SUBJECT + System.lineSeparator() + "CONTENT: " + CONTENT; assertEquals(HttpStatus.SC_OK, jsonResult.getStatusCode()); assertEquals(expectedLogMessage, action.getUserErrorReportLogMessage(report)); ______TS("Failure: Invalid report with null requestId"); assertThrows(InvalidHttpRequestBodyException.class, () -> { ErrorReportRequest badReport = new ErrorReportRequest(null, SUBJECT, CONTENT); SendErrorReportAction a = getAction(badReport, PARAMS); getJsonResult(a); }); ______TS("Failure: Invalid report with null SUBJECT"); assertThrows(InvalidHttpRequestBodyException.class, () -> { ErrorReportRequest badReport = new ErrorReportRequest(REQUEST_ID, null, CONTENT); SendErrorReportAction a = getAction(badReport, PARAMS); getJsonResult(a); }); ______TS("Failure: Invalid report with null CONTENT"); assertThrows(InvalidHttpRequestBodyException.class, () -> { ErrorReportRequest badReport = new ErrorReportRequest(REQUEST_ID, SUBJECT, null); SendErrorReportAction a = getAction(badReport, PARAMS); <START> getJsonResult(a); <END> }); }</code><technical_language>Pretty getAction trigger Exception, this is needed. Similarly for other cases above</technical_language>

Target:
protected void testExecute() throws Exception { gaeSimulation.logoutUser(); ______TS("Normal case: valid report with all fields populated"); ErrorReportRequest report = new ErrorReportRequest(REQUEST_ID, SUBJECT, CONTENT); SendErrorReportAction action = getAction(report, PARAMS); JsonResult jsonResult = getJsonResult(action); String expectedLogMessage = "====== USER FEEDBACK ABOUT ERROR ======" + System.lineSeparator() + "USER: Non-logged in user" + System.lineSeparator() + "REQUEST ID: " + REQUEST_ID + System.lineSeparator() + "SUBJECT: " + SUBJECT + System.lineSeparator() + "CONTENT: " + CONTENT; assertEquals(HttpStatus.SC_OK, jsonResult.getStatusCode()); assertEquals(expectedLogMessage, action.getUserErrorReportLogMessage(report)); ______TS("Failure: Invalid report with null requestId"); assertThrows(InvalidHttpRequestBodyException.class, () -> { ErrorReportRequest badReport = new ErrorReportRequest(null, SUBJECT, CONTENT); getAction(badReport, PARAMS).execute(); }); ______TS("Failure: Invalid report with null SUBJECT"); assertThrows(InvalidHttpRequestBodyException.class, () -> { ErrorReportRequest badReport = new ErrorReportRequest(REQUEST_ID, null, CONTENT); getAction(badReport, PARAMS).execute(); }); ______TS("Failure: Invalid report with null CONTENT"); assertThrows(InvalidHttpRequestBodyException.class, () -> { ErrorReportRequest badReport = new ErrorReportRequest(REQUEST_ID, SUBJECT, null); getAction(badReport, PARAMS).execute(); }); }