Source:
<code>protected void testExecute() throws Exception { ______TS("Verify no ongoing session"); String[] params = new String[] { Const.ParamsNames.FEEDBACK_SESSION_STARTTIME, "0", Const.ParamsNames.FEEDBACK_SESSION_ENDTIME, "1000", }; GetOngoingSessionsAction getOngoingSessionsAction = getAction(params); JsonResult r = getJsonResult(getOngoingSessionsAction); verifyNoExistingSession(r); ______TS("Typical use case"); InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); String courseId = instructor1OfCourse1.courseId; Instant startTime = Instant.now(); Instant endTime = Instant.now().plus(5, ChronoUnit.DAYS); <START> logic.createFeedbackSession(FeedbackSessionAttributes.builder("new-session", <END> courseId, instructor1OfCourse1.email).withStartTime(startTime) .withEndTime(endTime).withCreatedTime(startTime.minusSeconds(1)) .withSessionVisibleFromTime(startTime).withResultsVisibleFromTime(endTime).build()); params = new String[] { Const.ParamsNames.FEEDBACK_SESSION_STARTTIME, String.valueOf(startTime.toEpochMilli()), Const.ParamsNames.FEEDBACK_SESSION_ENDTIME, String.valueOf(endTime.toEpochMilli()), }; getOngoingSessionsAction = getAction(params); r = getJsonResult(getOngoingSessionsAction); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); OngoingSessionsData response = (OngoingSessionsData) r.getOutput(); assertEquals(0, response.getTotalAwaitingSessions()); assertEquals(1, response.getTotalOpenSessions()); assertEquals(0, response.getTotalClosedSessions()); assertEquals(1, response.getTotalOngoingSessions()); assertEquals(1, response.getTotalInstitutes()); assertEquals(1, response.getSessions().size()); assertEquals(null, response.getRequestId()); }</code><technical_language>Personally, I coding style for builder chain call. FeedbackSessionAttributes.builder(....) .withXXX() .withXXX() .build() is prefered. In addition, do break line high level. logic.createFeedbackSession( FeedbackSessionAttributes.builder("new-session", courseId, instructor1OfCourse1.email) this is preferred</technical_language>

Target:
protected void testExecute() throws Exception { ______TS("Verify no ongoing session"); String[] params = new String[] { Const.ParamsNames.FEEDBACK_SESSION_STARTTIME, "0", Const.ParamsNames.FEEDBACK_SESSION_ENDTIME, "1000", }; GetOngoingSessionsAction getOngoingSessionsAction = getAction(params); JsonResult r = getJsonResult(getOngoingSessionsAction); verifyNoExistingSession(r); ______TS("Typical use case"); InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); String courseId = instructor1OfCourse1.courseId; Instant startTime = Instant.now(); Instant endTime = Instant.now().plus(5, ChronoUnit.DAYS); logic.createFeedbackSession( FeedbackSessionAttributes.builder("new-session", courseId, instructor1OfCourse1.email) .withStartTime(startTime) .withEndTime(endTime) .withCreatedTime(startTime.minusSeconds(1)) .withSessionVisibleFromTime(startTime) .withResultsVisibleFromTime(endTime) .build()); params = new String[] { Const.ParamsNames.FEEDBACK_SESSION_STARTTIME, String.valueOf(startTime.toEpochMilli()), Const.ParamsNames.FEEDBACK_SESSION_ENDTIME, String.valueOf(endTime.toEpochMilli()), }; getOngoingSessionsAction = getAction(params); r = getJsonResult(getOngoingSessionsAction); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); OngoingSessionsData response = (OngoingSessionsData) r.getOutput(); assertEquals(0, response.getTotalAwaitingSessions()); assertEquals(1, response.getTotalOpenSessions()); assertEquals(0, response.getTotalClosedSessions()); assertEquals(1, response.getTotalOngoingSessions()); assertEquals(1, response.getTotalInstitutes()); assertEquals(1, response.getSessions().size()); }