@Test public void createTimestamp() throws InterruptedException { LegacyJavaRuntime runtime = new LegacyJavaRuntime(); Timestamp timestamp = runtime.createTimestamp(); assertThat(timestamp).isInstanceOf(LegacyTimestamp.class); assertThat(timestamp.toInstant()).isBetween(Instant.now().minusSeconds(1), Instant.now()); Thread.sleep(2); assertThat(runtime.createTimestamp().toInstant()).isAfter(timestamp.toInstant()); }
@Override public Timestamp createTimestamp() { return new LegacyTimestamp(); }
LegacyJavaRuntime extends AbstractJavaRuntime { @Override public Timestamp createTimestamp() { return new LegacyTimestamp(); } }
LegacyJavaRuntime extends AbstractJavaRuntime { @Override public Timestamp createTimestamp() { return new LegacyTimestamp(); } LegacyJavaRuntime(); }
LegacyJavaRuntime extends AbstractJavaRuntime { @Override public Timestamp createTimestamp() { return new LegacyTimestamp(); } LegacyJavaRuntime(); @Override boolean isAndroid(); @Override long getProcessId(); @Override Timestamp getStartTime(); @Override @SuppressWarnings("removal") @IgnoreJRERequirement String getCallerClassName(final int depth); @Override String getCallerClassName(final String loggerClassName); @Override StackTraceElement getCallerStackTraceElement(final int depth); @Override StackTraceElement getCallerStackTraceElement(final String loggerClassName); @Override Timestamp createTimestamp(); @Override TimestampFormatter createTimestampFormatter(final String pattern, final Locale locale); }
LegacyJavaRuntime extends AbstractJavaRuntime { @Override public Timestamp createTimestamp() { return new LegacyTimestamp(); } LegacyJavaRuntime(); @Override boolean isAndroid(); @Override long getProcessId(); @Override Timestamp getStartTime(); @Override @SuppressWarnings("removal") @IgnoreJRERequirement String getCallerClassName(final int depth); @Override String getCallerClassName(final String loggerClassName); @Override StackTraceElement getCallerStackTraceElement(final int depth); @Override StackTraceElement getCallerStackTraceElement(final String loggerClassName); @Override Timestamp createTimestamp(); @Override TimestampFormatter createTimestampFormatter(final String pattern, final Locale locale);  }