@Test void testNullThrows() { assertThrows(NullPointerException.class, () -> underTest.isCooldownExpired(null, Instant.now())); }
public boolean isCooldownExpired(UserSyncStatus userSyncStatus, Instant cooldownThresholdTime) { requireNonNull(userSyncStatus, "userSyncStatus is null"); boolean cool; if (userSyncStatus.getLastStartedFullSync() != null) { cool = Instant.ofEpochMilli(userSyncStatus.getLastStartedFullSync().getStartTime()).isBefore(cooldownThresholdTime); } else { cool = true; } if (LOGGER.isDebugEnabled()) { Stack stack = userSyncStatus.getStack(); LOGGER.debug("Synchronization to Environment {} in Account {} {} been run since {}", stack.getEnvironmentCrn(), stack.getAccountId(), cool ? "has not" : "has", DATE_TIME_FORMATTER.format(cooldownThresholdTime)); } return cool; }
CooldownChecker { public boolean isCooldownExpired(UserSyncStatus userSyncStatus, Instant cooldownThresholdTime) { requireNonNull(userSyncStatus, "userSyncStatus is null"); boolean cool; if (userSyncStatus.getLastStartedFullSync() != null) { cool = Instant.ofEpochMilli(userSyncStatus.getLastStartedFullSync().getStartTime()).isBefore(cooldownThresholdTime); } else { cool = true; } if (LOGGER.isDebugEnabled()) { Stack stack = userSyncStatus.getStack(); LOGGER.debug("Synchronization to Environment {} in Account {} {} been run since {}", stack.getEnvironmentCrn(), stack.getAccountId(), cool ? "has not" : "has", DATE_TIME_FORMATTER.format(cooldownThresholdTime)); } return cool; } }
CooldownChecker { public boolean isCooldownExpired(UserSyncStatus userSyncStatus, Instant cooldownThresholdTime) { requireNonNull(userSyncStatus, "userSyncStatus is null"); boolean cool; if (userSyncStatus.getLastStartedFullSync() != null) { cool = Instant.ofEpochMilli(userSyncStatus.getLastStartedFullSync().getStartTime()).isBefore(cooldownThresholdTime); } else { cool = true; } if (LOGGER.isDebugEnabled()) { Stack stack = userSyncStatus.getStack(); LOGGER.debug("Synchronization to Environment {} in Account {} {} been run since {}", stack.getEnvironmentCrn(), stack.getAccountId(), cool ? "has not" : "has", DATE_TIME_FORMATTER.format(cooldownThresholdTime)); } return cool; }  }
CooldownChecker { public boolean isCooldownExpired(UserSyncStatus userSyncStatus, Instant cooldownThresholdTime) { requireNonNull(userSyncStatus, "userSyncStatus is null"); boolean cool; if (userSyncStatus.getLastStartedFullSync() != null) { cool = Instant.ofEpochMilli(userSyncStatus.getLastStartedFullSync().getStartTime()).isBefore(cooldownThresholdTime); } else { cool = true; } if (LOGGER.isDebugEnabled()) { Stack stack = userSyncStatus.getStack(); LOGGER.debug("Synchronization to Environment {} in Account {} {} been run since {}", stack.getEnvironmentCrn(), stack.getAccountId(), cool ? "has not" : "has", DATE_TIME_FORMATTER.format(cooldownThresholdTime)); } return cool; }  boolean isCooldownExpired(UserSyncStatus userSyncStatus, Instant cooldownThresholdTime); }
CooldownChecker { public boolean isCooldownExpired(UserSyncStatus userSyncStatus, Instant cooldownThresholdTime) { requireNonNull(userSyncStatus, "userSyncStatus is null"); boolean cool; if (userSyncStatus.getLastStartedFullSync() != null) { cool = Instant.ofEpochMilli(userSyncStatus.getLastStartedFullSync().getStartTime()).isBefore(cooldownThresholdTime); } else { cool = true; } if (LOGGER.isDebugEnabled()) { Stack stack = userSyncStatus.getStack(); LOGGER.debug("Synchronization to Environment {} in Account {} {} been run since {}", stack.getEnvironmentCrn(), stack.getAccountId(), cool ? "has not" : "has", DATE_TIME_FORMATTER.format(cooldownThresholdTime)); } return cool; }  boolean isCooldownExpired(UserSyncStatus userSyncStatus, Instant cooldownThresholdTime);  }