UserUpdateJob extends FixedHourScheduledJob { @Override public void execute(LocalDateTime lastExecuteTime) { userUpdater.updateHierarchyAndUserData(); log.debug("Successfully updated users and hierarchy!"); } @Autowired  UserUpdateJob(UserUpdater userUpdater, LdapConfigurationProperties properties, Clock clock); @Override void execute(LocalDateTime lastExecuteTime); @Override void execute(); @Override String getJobIdentifier();  }
@Test public void executeWithTimeUpdatesUsersAndHierarchy() { var lastExecuteTime = LocalDateTime.now(clock); userUpdateJob.execute(lastExecuteTime); verify(userUpdaterMock).updateHierarchyAndUserData(); }
@Test public void executeUpdatesUsersAndHierarchy() { userUpdateJob.execute(); verify(userUpdaterMock).updateHierarchyAndUserData(); }