Skip to content

Commit

Permalink
HHH-17975 add testcase for retrieving revision by an Instant
Browse files Browse the repository at this point in the history
  • Loading branch information
fheck authored and beikov committed Apr 19, 2024
1 parent ac49021 commit e459eb2
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,20 @@ public void testRevisionsForDates() {

assert vr.getRevisionDate( vr.getRevisionNumberForDate( new Date( timestamp4 ) ) ).getTime() <= timestamp4;
}

@Test
@SkipForDialect(value = CockroachDialect.class, comment = "Fails because of int size")
public void testRevisionsForInstant() {
AuditReader vr = getAuditReader();

assert vr.getRevisionDate( vr.getRevisionNumberForDate( new Date( timestamp2 ).toInstant() ) ).getTime() <= timestamp2;
assert vr.getRevisionDate( vr.getRevisionNumberForDate( new Date( timestamp2 ).toInstant() ).intValue() + 1 )
.getTime() > timestamp2;

assert vr.getRevisionDate( vr.getRevisionNumberForDate( new Date( timestamp3 ).toInstant() ) ).getTime() <= timestamp3;
assert vr.getRevisionDate( vr.getRevisionNumberForDate( new Date( timestamp3 ).toInstant() ).intValue() + 1 )
.getTime() > timestamp3;

assert vr.getRevisionDate( vr.getRevisionNumberForDate( new Date( timestamp4 ).toInstant() ) ).getTime() <= timestamp4;
}
}

0 comments on commit e459eb2

Please sign in to comment.