@Test public void printsTheCurrentTime() throws Exception { assertThat(healthCheckTimestamp.check().toString(), matchesRegex( "Result\\{isHealthy=true, message=1970-01-01T00:00:00.001\\+0000, timestamp=.*\\}")); }
@Override protected Result check() { ZonedDateTime now = Instant.ofEpochMilli(clock.tickMillis()).atZone(UTC); return healthy(DATE_TIME_FORMATTER.format(now)); }
HealthCheckTimestamp extends HealthCheck { @Override protected Result check() { ZonedDateTime now = Instant.ofEpochMilli(clock.tickMillis()).atZone(UTC); return healthy(DATE_TIME_FORMATTER.format(now)); } }
HealthCheckTimestamp extends HealthCheck { @Override protected Result check() { ZonedDateTime now = Instant.ofEpochMilli(clock.tickMillis()).atZone(UTC); return healthy(DATE_TIME_FORMATTER.format(now)); } HealthCheckTimestamp();  HealthCheckTimestamp(Clock clock); }
HealthCheckTimestamp extends HealthCheck { @Override protected Result check() { ZonedDateTime now = Instant.ofEpochMilli(clock.tickMillis()).atZone(UTC); return healthy(DATE_TIME_FORMATTER.format(now)); } HealthCheckTimestamp();  HealthCheckTimestamp(Clock clock);  }
HealthCheckTimestamp extends HealthCheck { @Override protected Result check() { ZonedDateTime now = Instant.ofEpochMilli(clock.tickMillis()).atZone(UTC); return healthy(DATE_TIME_FORMATTER.format(now)); } HealthCheckTimestamp();  HealthCheckTimestamp(Clock clock);  static final String NAME; }