TimestampMeasurementElement implements MeasurementElement, Serializable { public Long getValue() { return this.value; } TimestampMeasurementElement(final long value);  TimestampMeasurementElement(final ZonedDateTime zonedDateTime); Long getValue(); ZonedDateTime asZonedDateTime(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void getValueShouldReturnCorrectValueWhenConstructedUsingTimestamp() { final ZonedDateTime zonedDateTime = ZonedDateTime.of(2020, 2, 20, 21, 59, 59, 0, ZoneOffset.UTC); final long expected = zonedDateTime.toInstant().toEpochMilli(); final TimestampMeasurementElement element = new TimestampMeasurementElement(expected); final long actual = element.getValue(); assertThat(actual).isEqualTo(expected); }
@Test public void getValueShouldReturnCorrectValueWhenConstructedUsingZonedDateTime() { final ZonedDateTime zonedDateTime = ZonedDateTime.of(2020, 2, 20, 21, 59, 59, 0, ZoneOffset.UTC); final long expected = zonedDateTime.toInstant().toEpochMilli(); final TimestampMeasurementElement element = new TimestampMeasurementElement(zonedDateTime); final long actual = element.getValue(); assertThat(actual).isEqualTo(expected); }