Source:
<code>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(), }; <START> assertNotNull(logic.getFeedbackSessionDetails(session.getFeedbackSessionName(), course.getId())); <END> 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())); }</code><technical_language>suggestion assertNotNull(logic.getFeedbackSession(session.getFeedbackSessionName(), course.getId())); getFeedbackSession is enough</technical_language>

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())); }