@Test public void missingNexusYieldsEmpty() { when(logManager.getLogFor(DEFAULT_LOGGER)).thenReturn(Optional.of("nexus.log")); when(logManager.getLogFile("nexus.log")).thenReturn(null); lastShutdownTimeService = new LastShutdownTimeServiceImpl(logManager, true); assertThat(lastShutdownTimeService.estimateLastShutdownTime().isPresent(), equalTo(false)); }
@Override public synchronized Optional<Date> estimateLastShutdownTime() { if (shutdownTimeGuess == null) { shutdownTimeGuess = findBestEstimate(logManager); } return shutdownTimeGuess; }
LastShutdownTimeServiceImpl extends ComponentSupport implements LastShutdownTimeService { @Override public synchronized Optional<Date> estimateLastShutdownTime() { if (shutdownTimeGuess == null) { shutdownTimeGuess = findBestEstimate(logManager); } return shutdownTimeGuess; } }
LastShutdownTimeServiceImpl extends ComponentSupport implements LastShutdownTimeService { @Override public synchronized Optional<Date> estimateLastShutdownTime() { if (shutdownTimeGuess == null) { shutdownTimeGuess = findBestEstimate(logManager); } return shutdownTimeGuess; } @Inject  LastShutdownTimeServiceImpl(final LogManager logManager,
                                     @Named("${nexus.log.lastShutdownTime.enabled:-true}") final boolean enabled); }
LastShutdownTimeServiceImpl extends ComponentSupport implements LastShutdownTimeService { @Override public synchronized Optional<Date> estimateLastShutdownTime() { if (shutdownTimeGuess == null) { shutdownTimeGuess = findBestEstimate(logManager); } return shutdownTimeGuess; } @Inject  LastShutdownTimeServiceImpl(final LogManager logManager,
                                     @Named("${nexus.log.lastShutdownTime.enabled:-true}") final boolean enabled); @Override synchronized Optional<Date> estimateLastShutdownTime(); }
LastShutdownTimeServiceImpl extends ComponentSupport implements LastShutdownTimeService { @Override public synchronized Optional<Date> estimateLastShutdownTime() { if (shutdownTimeGuess == null) { shutdownTimeGuess = findBestEstimate(logManager); } return shutdownTimeGuess; } @Inject  LastShutdownTimeServiceImpl(final LogManager logManager,
                                     @Named("${nexus.log.lastShutdownTime.enabled:-true}") final boolean enabled); @Override synchronized Optional<Date> estimateLastShutdownTime();  }