test_class.declarator: userServiceMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UserService userServiceMock;
test_class.type: UserService
test_class.var_name: userServiceMock
test_class.declarator: bookmarkServiceMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private BookmarkService bookmarkServiceMock;
test_class.type: BookmarkService
test_class.var_name: bookmarkServiceMock
test_class.declarator: airMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private AccessIntervalRepository airMock;
test_class.type: AccessIntervalRepository
test_class.var_name: airMock
test_class.declarator: accessIntervalMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private AccessInterval accessIntervalMock;
test_class.type: AccessInterval
test_class.var_name: accessIntervalMock
test_class.declarator: userMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private User userMock;
test_class.type: User
test_class.var_name: userMock
test_class.declarator: cleaner
test_class.modifier: private
test_class.original_string: private ApplicationsAndBookmarkCleaner cleaner;
test_class.type: ApplicationsAndBookmarkCleaner
test_class.var_name: cleaner
test_class.declarator: clock
test_class.modifier: private
test_class.original_string: private Clock clock;
test_class.type: Clock
test_class.var_name: clock
test_class.file: backend/project-board/src/test/java/de/adesso/projectboard/base/cleaner/ApplicationsAndBookmarkCleanerTest.java
test_class.identifier: ApplicationsAndBookmarkCleanerTest
test_case.body: @Test
      public void removeOldBookmarksAndApplications() {
          // given
          var firstIntervalEndTime = LocalDateTime.now(clock).minus(29L, ChronoUnit.DAYS);
          var secondIntervalEndTime = LocalDateTime.now(clock).plus(2L, ChronoUnit.DAYS);
  
          given(airMock.findAllLatestIntervals()).willReturn(List.of(accessIntervalMock, accessIntervalMock));
  
          given(accessIntervalMock.getEndTime()).willReturn(firstIntervalEndTime, secondIntervalEndTime);
          given(accessIntervalMock.getUser()).willReturn(userMock);
  
          // when
          cleaner.removeOldBookmarksAndApplications();
  
          // then
          verify(bookmarkServiceMock).removeAllBookmarksOfUser(userMock);
          verify(userServiceMock).removeAllApplicationsOfUser(userMock);
      }
test_case.class_method_signature: ApplicationsAndBookmarkCleanerTest.removeOldBookmarksAndApplications()
test_case.full_signature: @Test public void removeOldBookmarksAndApplications()
test_case.identifier: removeOldBookmarksAndApplications
test_case.invocations: minus now plus now willReturn given findAllLatestIntervals of willReturn given getEndTime willReturn given getUser removeOldBookmarksAndApplications removeAllBookmarksOfUser verify removeAllApplicationsOfUser verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void removeOldBookmarksAndApplications()
focal_class.declarator: EXECUTION_HOUR = 3
focal_class.modifier: private static final
focal_class.original_string: private static final int EXECUTION_HOUR = 3;
focal_class.type: int
focal_class.var_name: EXECUTION_HOUR
focal_class.declarator: userService
focal_class.modifier: private final
focal_class.original_string: private final UserService userService;
focal_class.type: UserService
focal_class.var_name: userService
focal_class.declarator: bookmarkService
focal_class.modifier: private final
focal_class.original_string: private final BookmarkService bookmarkService;
focal_class.type: BookmarkService
focal_class.var_name: bookmarkService
focal_class.declarator: accessIntervalRepo
focal_class.modifier: private final
focal_class.original_string: private final AccessIntervalRepository accessIntervalRepo;
focal_class.type: AccessIntervalRepository
focal_class.var_name: accessIntervalRepo
focal_class.declarator: clock
focal_class.modifier: private final
focal_class.original_string: private final Clock clock;
focal_class.type: Clock
focal_class.var_name: clock
focal_class.file: backend/project-board/src/main/java/de/adesso/projectboard/base/cleaner/ApplicationsAndBookmarkCleaner.java
focal_class.identifier: ApplicationsAndBookmarkCleaner
focal_class.class_method_signature: ApplicationsAndBookmarkCleaner.ApplicationsAndBookmarkCleaner(UserService userService,
                                            BookmarkService bookmarkService,
                                            AccessIntervalRepository accessIntervalRepo,
                                            Clock clock)
focal_class.full_signature: @Autowired public  ApplicationsAndBookmarkCleaner(UserService userService,
                                            BookmarkService bookmarkService,
                                            AccessIntervalRepository accessIntervalRepo,
                                            Clock clock)
focal_class.identifier: ApplicationsAndBookmarkCleaner
focal_class.modifiers: @Autowired public
focal_class.parameters: (UserService userService,
                                            BookmarkService bookmarkService,
                                            AccessIntervalRepository accessIntervalRepo,
                                            Clock clock)
focal_class.signature:  ApplicationsAndBookmarkCleaner(UserService userService,
                                            BookmarkService bookmarkService,
                                            AccessIntervalRepository accessIntervalRepo,
                                            Clock clock)
focal_class.class_method_signature: ApplicationsAndBookmarkCleaner.removeOldBookmarksAndApplications()
focal_class.full_signature:  void removeOldBookmarksAndApplications()
focal_class.identifier: removeOldBookmarksAndApplications
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void removeOldBookmarksAndApplications()
focal_class.class_method_signature: ApplicationsAndBookmarkCleaner.execute(LocalDateTime lastExecuteTime)
focal_class.full_signature: @Override public void execute(LocalDateTime lastExecuteTime)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (LocalDateTime lastExecuteTime)
focal_class.return: void
focal_class.signature: void execute(LocalDateTime lastExecuteTime)
focal_class.class_method_signature: ApplicationsAndBookmarkCleaner.execute()
focal_class.full_signature: @Override public void execute()
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void execute()
focal_class.class_method_signature: ApplicationsAndBookmarkCleaner.getJobIdentifier()
focal_class.full_signature: @Override public String getJobIdentifier()
focal_class.identifier: getJobIdentifier
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getJobIdentifier()
focal_class.superclass: extends FixedHourScheduledJob
focal_method.body: void removeOldBookmarksAndApplications() {
          var latestAccessIntervals = accessIntervalRepo.findAllLatestIntervals();
  
          for (AccessInterval interval : latestAccessIntervals) {
              if (interval.getEndTime().plusDays(28L).isBefore(LocalDateTime.now(clock))) {
                  bookmarkService.removeAllBookmarksOfUser(interval.getUser());
                  userService.removeAllApplicationsOfUser(interval.getUser());
  
                  log.debug("deleted bookmarks and applications of user " + interval.getUser().getId());
              }
          }
      }
focal_method.class_method_signature: ApplicationsAndBookmarkCleaner.removeOldBookmarksAndApplications()
focal_method.full_signature:  void removeOldBookmarksAndApplications()
focal_method.identifier: removeOldBookmarksAndApplications
focal_method.invocations: findAllLatestIntervals isBefore plusDays getEndTime now removeAllBookmarksOfUser getUser removeAllApplicationsOfUser getUser debug getId getUser
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void removeOldBookmarksAndApplications()