use of com.epam.pipeline.entity.docker.HistoryEntry in project cloud-pipeline by epam.
the class DockerDateUtilsTest method shouldCalculateLatestAndEarliestDateTimeProperly.
@Test
public void shouldCalculateLatestAndEarliestDateTimeProperly() {
HistoryEntry entryWithEarliestDate = new HistoryEntry();
entryWithEarliestDate.setV1Compatibility(EARLIEST_DATE);
HistoryEntry entryWithLatestDate = new HistoryEntry();
entryWithLatestDate.setV1Compatibility(LATEST_DATE);
HistoryEntry entryWithShortDate = new HistoryEntry();
entryWithShortDate.setV1Compatibility(SHORT_DATE);
RawImageDescription description = new RawImageDescription();
description.setHistory(Arrays.asList(entryWithEarliestDate, entryWithLatestDate, entryWithShortDate));
assertThat(DockerDateUtils.getEarliestDate(description).toInstant().atZone(ZoneOffset.UTC).getMinute()).isEqualTo(EARLIEST_MINUTES);
assertThat(DockerDateUtils.getLatestDate(description).toInstant().atZone(ZoneOffset.UTC).getMinute()).isEqualTo(LATEST_MINUTES);
}
Aggregations