diff --git a/src/it/java/teammates/it/ui/webapi/UpdateAccountRequestActionIT.java b/src/it/java/teammates/it/ui/webapi/UpdateAccountRequestActionIT.java index f5932deaf99..7687f80813f 100644 --- a/src/it/java/teammates/it/ui/webapi/UpdateAccountRequestActionIT.java +++ b/src/it/java/teammates/it/ui/webapi/UpdateAccountRequestActionIT.java @@ -257,6 +257,8 @@ protected void tearDown() { for (AccountRequest ar : accountRequests) { logic.deleteAccountRequest(ar.getId()); } + + logic.deleteAccount(getTypicalAccount().getGoogleId()); HibernateUtil.commitTransaction(); } } diff --git a/src/it/java/teammates/it/ui/webapi/UpdateFeedbackSessionLogsActionIT.java b/src/it/java/teammates/it/ui/webapi/UpdateFeedbackSessionLogsActionIT.java index b6f2a8b1f47..8c5a0c6f21d 100644 --- a/src/it/java/teammates/it/ui/webapi/UpdateFeedbackSessionLogsActionIT.java +++ b/src/it/java/teammates/it/ui/webapi/UpdateFeedbackSessionLogsActionIT.java @@ -82,47 +82,52 @@ String getRequestMethod() { @Override protected void testExecute() { ______TS("No spam all logs added"); + + // Gap is larger than spam filter + mockLogsProcessor.insertFeedbackSessionLog(course1.getId(), student1InCourse1.getId(), + session1InCourse1.getId(), FeedbackSessionLogType.ACCESS.getLabel(), startTime.toEpochMilli()); + mockLogsProcessor.insertFeedbackSessionLog(course1.getId(), student1InCourse1.getId(), + session1InCourse1.getId(), FeedbackSessionLogType.ACCESS.getLabel(), + startTime.plusMillis(SPAM_FILTER + 1).toEpochMilli()); + // Different Types + long padding = 3 * SPAM_FILTER; mockLogsProcessor.insertFeedbackSessionLog(course1.getId(), student1InCourse1.getId(), session1InCourse1.getId(), FeedbackSessionLogType.ACCESS.getLabel(), - startTime.plusSeconds(100).toEpochMilli()); + startTime.plusMillis(padding).toEpochMilli()); mockLogsProcessor.insertFeedbackSessionLog(course1.getId(), student1InCourse1.getId(), session1InCourse1.getId(), FeedbackSessionLogType.SUBMISSION.getLabel(), - startTime.plusSeconds(100).toEpochMilli()); + startTime.plusMillis(padding + 1).toEpochMilli()); mockLogsProcessor.insertFeedbackSessionLog(course1.getId(), student1InCourse1.getId(), session1InCourse1.getId(), FeedbackSessionLogType.VIEW_RESULT.getLabel(), - startTime.plusSeconds(100).toEpochMilli()); + startTime.plusMillis(padding + 2).toEpochMilli()); // Different feedback sessions + padding = 5 * SPAM_FILTER; mockLogsProcessor.insertFeedbackSessionLog(course1.getId(), student1InCourse1.getId(), session1InCourse1.getId(), FeedbackSessionLogType.ACCESS.getLabel(), - startTime.plusSeconds(200).toEpochMilli()); + startTime.plusMillis(padding).toEpochMilli()); mockLogsProcessor.insertFeedbackSessionLog(course1.getId(), student1InCourse1.getId(), session2InCourse1.getId(), FeedbackSessionLogType.ACCESS.getLabel(), - startTime.plusSeconds(200).toEpochMilli()); + startTime.plusMillis(padding + 1).toEpochMilli()); // Different Student + padding = 7 * SPAM_FILTER; mockLogsProcessor.insertFeedbackSessionLog(course1.getId(), student1InCourse1.getId(), session1InCourse1.getId(), FeedbackSessionLogType.ACCESS.getLabel(), - startTime.plusSeconds(300).toEpochMilli()); + startTime.plusMillis(padding).toEpochMilli()); mockLogsProcessor.insertFeedbackSessionLog(course1.getId(), student2InCourse1.getId(), session1InCourse1.getId(), FeedbackSessionLogType.ACCESS.getLabel(), - startTime.plusSeconds(300).toEpochMilli()); + startTime.plusMillis(padding + 1).toEpochMilli()); // Different course + padding = 9 * SPAM_FILTER; mockLogsProcessor.insertFeedbackSessionLog(course1.getId(), student1InCourse1.getId(), session1InCourse1.getId(), FeedbackSessionLogType.ACCESS.getLabel(), - startTime.plusSeconds(400).toEpochMilli()); + startTime.plusMillis(padding).toEpochMilli()); mockLogsProcessor.insertFeedbackSessionLog(course3.getId(), student1InCourse3.getId(), session1InCourse3.getId(), FeedbackSessionLogType.ACCESS.getLabel(), - startTime.plusSeconds(400).toEpochMilli()); - - // Gap is larger than spam filter - mockLogsProcessor.insertFeedbackSessionLog(course1.getId(), student1InCourse1.getId(), - session1InCourse1.getId(), FeedbackSessionLogType.ACCESS.getLabel(), startTime.toEpochMilli()); - mockLogsProcessor.insertFeedbackSessionLog(course1.getId(), student1InCourse1.getId(), - session1InCourse1.getId(), FeedbackSessionLogType.ACCESS.getLabel(), - startTime.plusMillis(SPAM_FILTER + 1).toEpochMilli()); + startTime.plusMillis(padding + 1).toEpochMilli()); UpdateFeedbackSessionLogsAction action = getAction(); getJsonResult(action);