Search in sources :

Example 1 with HistoryEntryDTO

use of org.opengrok.web.api.v1.controller.HistoryController.HistoryEntryDTO in project OpenGrok by OpenGrok.

the class HistoryControllerTest method testHistoryDTOEquals.

@Test
public void testHistoryDTOEquals() {
    HistoryEntry historyEntry = new HistoryEntry("1", new Date(1245446973L / 60 * 60 * 1000), "xyz", "foo", true);
    HistoryEntryDTO entry1 = new HistoryEntryDTO(historyEntry);
    historyEntry.setAuthor("abc");
    HistoryEntryDTO entry2 = new HistoryEntryDTO(historyEntry);
    assertEquals(entry1, entry1);
    assertNotEquals(entry1, entry2);
    HistoryDTO history1 = new HistoryDTO(Collections.singletonList(entry1), 0, 1, 1);
    HistoryDTO history2 = new HistoryDTO(Collections.singletonList(entry2), 0, 1, 1);
    assertEquals(history1, history1);
    assertNotEquals(history1, history2);
}
Also used : HistoryDTO(org.opengrok.web.api.v1.controller.HistoryController.HistoryDTO) HistoryController.getHistoryDTO(org.opengrok.web.api.v1.controller.HistoryController.getHistoryDTO) HistoryEntry(org.opengrok.indexer.history.HistoryEntry) Date(java.util.Date) HistoryEntryDTO(org.opengrok.web.api.v1.controller.HistoryController.HistoryEntryDTO) Test(org.junit.jupiter.api.Test)

Aggregations

Date (java.util.Date)1 Test (org.junit.jupiter.api.Test)1 HistoryEntry (org.opengrok.indexer.history.HistoryEntry)1 HistoryDTO (org.opengrok.web.api.v1.controller.HistoryController.HistoryDTO)1 HistoryEntryDTO (org.opengrok.web.api.v1.controller.HistoryController.HistoryEntryDTO)1 HistoryController.getHistoryDTO (org.opengrok.web.api.v1.controller.HistoryController.getHistoryDTO)1