@Test public void testConvertLocalDateTimeToEpoch() { LocalDateTime localDateTime = LocalDateTime.of(1970, 01, 01, 00, 00, 00); long expectEpoch = ZonedDateTime.of(localDateTime, ZoneId.systemDefault()).toEpochSecond()*1000; long resultEpoch = reportTypeConvert.convertLocalDateTimeToEpoch(localDateTime); Assert.assertEquals(expectEpoch,resultEpoch); }
@Override public long convertLocalDateTimeToEpoch(LocalDateTime localDateTime) { Assert.notNull(localDateTime, "localDateTime cannot be null"); ZoneId zoneId = ZoneId.systemDefault(); long epoch = localDateTime.atZone(zoneId).toInstant().toEpochMilli(); return epoch; }
ReportTypeConvert implements ReportUtils { @Override public long convertLocalDateTimeToEpoch(LocalDateTime localDateTime) { Assert.notNull(localDateTime, "localDateTime cannot be null"); ZoneId zoneId = ZoneId.systemDefault(); long epoch = localDateTime.atZone(zoneId).toInstant().toEpochMilli(); return epoch; } }
ReportTypeConvert implements ReportUtils { @Override public long convertLocalDateTimeToEpoch(LocalDateTime localDateTime) { Assert.notNull(localDateTime, "localDateTime cannot be null"); ZoneId zoneId = ZoneId.systemDefault(); long epoch = localDateTime.atZone(zoneId).toInstant().toEpochMilli(); return epoch; }  }
ReportTypeConvert implements ReportUtils { @Override public long convertLocalDateTimeToEpoch(LocalDateTime localDateTime) { Assert.notNull(localDateTime, "localDateTime cannot be null"); ZoneId zoneId = ZoneId.systemDefault(); long epoch = localDateTime.atZone(zoneId).toInstant().toEpochMilli(); return epoch; }  @Override LocalDateTime getStartDateTime(LocalDate localDate); @Override LocalDateTime getEndDateTime(LocalDate localDate); @Override long convertLocalDateTimeToEpoch(LocalDateTime localDateTime); }
ReportTypeConvert implements ReportUtils { @Override public long convertLocalDateTimeToEpoch(LocalDateTime localDateTime) { Assert.notNull(localDateTime, "localDateTime cannot be null"); ZoneId zoneId = ZoneId.systemDefault(); long epoch = localDateTime.atZone(zoneId).toInstant().toEpochMilli(); return epoch; }  @Override LocalDateTime getStartDateTime(LocalDate localDate); @Override LocalDateTime getEndDateTime(LocalDate localDate); @Override long convertLocalDateTimeToEpoch(LocalDateTime localDateTime);  }