Source:
public void testDeleteFeedbackSessionAction_typicalCase_shouldPass() throws Exception { ______TS("Delete session that has been soft deleted"); CourseAttributes course = typicalBundle.courses.get("typicalCourse1"); FeedbackSessionAttributes session = typicalBundle.feedbackSessions.get("session1InCourse1"); String[] params = new String[] { Const.ParamsNames.COURSE_ID, course.getId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, session.getFeedbackSessionName(), }; assertNotNull(logic.getFeedbackSessionDetails(session.getFeedbackSessionName(), course.getId())); logic.moveFeedbackSessionToRecycleBin(session.getFeedbackSessionName(), course.getId()); assertNotNull(logic.getFeedbackSessionFromRecycleBin(session.getFeedbackSessionName(), course.getId())); DeleteFeedbackSessionAction deleteFeedbackSessionAction = getAction(params); JsonResult result = getJsonResult(deleteFeedbackSessionAction); MessageOutput messageOutput = (MessageOutput) result.getOutput(); assertEquals(messageOutput.getMessage(), "The feedback session is deleted."); assertNull(logic.getFeedbackSessionFromRecycleBin(session.getFeedbackSessionName(), course.getId())); ______TS("Delete session not in recycle bin"); FeedbackSessionAttributes session2 = typicalBundle.feedbackSessions.get("session2InCourse1"); params = new String[] { Const.ParamsNames.COURSE_ID, course.getId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, session2.getFeedbackSessionName(), }; assertNull(logic.getFeedbackSessionFromRecycleBin(session2.getFeedbackSessionName(), course.getId())); assertNotNull(logic.getFeedbackSessionDetails(session2.getFeedbackSessionName(), course.getId())); deleteFeedbackSessionAction = getAction(params); result = getJsonResult(deleteFeedbackSessionAction); messageOutput = (MessageOutput) result.getOutput(); assertEquals(messageOutput.getMessage(), "The feedback session is deleted."); assertThrows(EntityDoesNotExistException.class, () -> logic.getFeedbackSessionDetails(session2.getFeedbackSessionName(), course.getId())); }

Target:
public void testDeleteFeedbackSessionAction_typicalCase_shouldPass() throws Exception { ______TS("Delete session that has been soft deleted"); CourseAttributes course = typicalBundle.courses.get("typicalCourse1"); FeedbackSessionAttributes session = typicalBundle.feedbackSessions.get("session1InCourse1"); String[] params = new String[] { Const.ParamsNames.COURSE_ID, course.getId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, session.getFeedbackSessionName(), }; assertNotNull(logic.getFeedbackSession(session.getFeedbackSessionName(), course.getId())); logic.moveFeedbackSessionToRecycleBin(session.getFeedbackSessionName(), course.getId()); assertNotNull(logic.getFeedbackSessionFromRecycleBin(session.getFeedbackSessionName(), course.getId())); DeleteFeedbackSessionAction deleteFeedbackSessionAction = getAction(params); JsonResult result = getJsonResult(deleteFeedbackSessionAction); MessageOutput messageOutput = (MessageOutput) result.getOutput(); assertEquals(messageOutput.getMessage(), "The feedback session is deleted."); assertNull(logic.getFeedbackSessionFromRecycleBin(session.getFeedbackSessionName(), course.getId())); assertNull(logic.getFeedbackSession(session.getFeedbackSessionName(), course.getId())); ______TS("Delete session not in recycle bin"); FeedbackSessionAttributes session2 = typicalBundle.feedbackSessions.get("session2InCourse1"); params = new String[] { Const.ParamsNames.COURSE_ID, course.getId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, session2.getFeedbackSessionName(), }; assertNull(logic.getFeedbackSessionFromRecycleBin(session2.getFeedbackSessionName(), course.getId())); assertNotNull(logic.getFeedbackSession(session2.getFeedbackSessionName(), course.getId())); deleteFeedbackSessionAction = getAction(params); result = getJsonResult(deleteFeedbackSessionAction); messageOutput = (MessageOutput) result.getOutput(); assertEquals(messageOutput.getMessage(), "The feedback session is deleted."); assertNull(logic.getFeedbackSessionFromRecycleBin(session2.getFeedbackSessionName(), course.getId())); assertNull(logic.getFeedbackSession(session2.getFeedbackSessionName(), course.getId())); }