use of net.nemerosa.ontrack.model.structure.Project in project ontrack by nemerosa.
the class EntityDataStoreRecordTest method compare_on_date_only.
@Test
public void compare_on_date_only() {
Project project = Project.of(NameDescription.nd("P", ""));
LocalDateTime now = Time.now();
LocalDateTime t1 = now.minusDays(1);
LocalDateTime t2 = now.minusDays(2);
List<EntityDataStoreRecord> records = Arrays.asList(new EntityDataStoreRecord(1, project, "TEST", "N1", null, Signature.of(t1, "test"), new IntNode(10)), new EntityDataStoreRecord(2, project, "TEST", "N1", null, Signature.of(t2, "test"), new IntNode(10)));
records.sort(Comparator.naturalOrder());
assertTrue("Newest record is first", records.get(0).getId() == 1);
}
Aggregations