@Test public void test_it_extracts_timestamps_from_log_messages() { Instant now = Instant.now(); long timestampNanos = now.getEpochSecond() * 1000000000 + now.getNano(); Instant instantFromNanos = Instant.ofEpochSecond(0, timestampNanos); assertEquals(now, instantFromNanos); long logMessageTimestamp = 1495200772630779308L; Instant instantFromLogMessage = cloudFoundryApi.getInstantFromLogMessageTimestamp(logMessageTimestamp); assertEquals("2017-05-19T13:32:52.630779308Z", instantFromLogMessage.toString()); }
public Instant getInstantFromLogMessageTimestamp(Long logMessageTimestamp) { return Instant.ofEpochSecond(0, logMessageTimestamp); }
CloudFoundryApi implements CloudFoundryApiService { public Instant getInstantFromLogMessageTimestamp(Long logMessageTimestamp) { return Instant.ofEpochSecond(0, logMessageTimestamp); } }
CloudFoundryApi implements CloudFoundryApiService { public Instant getInstantFromLogMessageTimestamp(Long logMessageTimestamp) { return Instant.ofEpochSecond(0, logMessageTimestamp); }  }
CloudFoundryApi implements CloudFoundryApiService { public Instant getInstantFromLogMessageTimestamp(Long logMessageTimestamp) { return Instant.ofEpochSecond(0, logMessageTimestamp); }  @Override void bindApplications(String serviceInstanceId, List<ApplicationIdentity> applications); void bindRoutes(String serviceInstanceId, List<String> routeIds); @Override ApplicationActivity getApplicationActivity(String appUid); Instant getInstantFromLogMessageTimestamp(Long logMessageTimestamp); @Override String getApplicationState(String applicationUuid); @Override String getHost(String routeId); @Override boolean isAppRunning(String appUid); @Override List<ApplicationIdentity> listAliveApplications(String spaceUuid, Pattern excludeNames); @Override List<String> listApplicationRoutes(String applicationUuid); @Override List<String> listRouteApplications(String routeUuid); @Override boolean startApplication(String applicationUuid); @Override boolean stopApplication(String applicationUuid); @Override void unbind(String bindingId); boolean isValidOrganization(String organizationGuid); }
CloudFoundryApi implements CloudFoundryApiService { public Instant getInstantFromLogMessageTimestamp(Long logMessageTimestamp) { return Instant.ofEpochSecond(0, logMessageTimestamp); }  @Override void bindApplications(String serviceInstanceId, List<ApplicationIdentity> applications); void bindRoutes(String serviceInstanceId, List<String> routeIds); @Override ApplicationActivity getApplicationActivity(String appUid); Instant getInstantFromLogMessageTimestamp(Long logMessageTimestamp); @Override String getApplicationState(String applicationUuid); @Override String getHost(String routeId); @Override boolean isAppRunning(String appUid); @Override List<ApplicationIdentity> listAliveApplications(String spaceUuid, Pattern excludeNames); @Override List<String> listApplicationRoutes(String applicationUuid); @Override List<String> listRouteApplications(String routeUuid); @Override boolean startApplication(String applicationUuid); @Override boolean stopApplication(String applicationUuid); @Override void unbind(String bindingId); boolean isValidOrganization(String organizationGuid);  }