Add some delay between save an update of update-timestamp tests

This commit is contained in:
Christian Beikov 2021-08-05 17:44:35 +02:00
parent 62514e9e53
commit dd650705d0
1 changed files with 7 additions and 0 deletions

View File

@ -47,6 +47,13 @@ public class InVmGenerationsWithAnnotationsWithSqlDateTests {
assertThat( saved.lastUpdatedOn ).isNotNull(); assertThat( saved.lastUpdatedOn ).isNotNull();
saved.name = "changed"; saved.name = "changed";
// Let's sleep a millisecond to make sure we actually generate a different timestamp
try {
Thread.sleep( 1L );
}
catch (InterruptedException e) {
// Ignore
}
// then changing // then changing
final AuditedEntity merged = scope.fromTransaction( session, (s) -> { final AuditedEntity merged = scope.fromTransaction( session, (s) -> {