Skip to content

Commit f9585cf

Browse files
committed
test inequality of HistoryEntry instances
1 parent e0d55db commit f9585cf

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

opengrok-indexer/src/test/java/org/opengrok/indexer/history/HistoryEntryTest.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
package org.opengrok.indexer.history;
2424

@@ -292,6 +292,22 @@ public void testEquals() {
292292
assertEquals(e, instance);
293293
}
294294

295+
@Test
296+
public void testNotEqualsRevision() {
297+
HistoryEntry e = new HistoryEntry(historyRevision + "0", historyDisplayRevision, historyDate,
298+
historyAuthor, historyMessage, true, null);
299+
assertNotSame(e, instance);
300+
assertNotEquals(e, instance);
301+
}
302+
303+
@Test
304+
public void testNotEqualsDisplayRevision() {
305+
HistoryEntry e = new HistoryEntry(historyRevision, historyDisplayRevision + "0", historyDate,
306+
historyAuthor, historyMessage, true, null);
307+
assertNotSame(e, instance);
308+
assertNotEquals(e, instance);
309+
}
310+
295311
@Test
296312
public void testEqualsWithFilesInstance() {
297313
HistoryEntry e = new HistoryEntry(historyRevision, historyDisplayRevision, historyDate,

0 commit comments

Comments
 (0)