Add a millisecond sleep to ensure generated timestamp annotation tests work

This commit is contained in:
Christian Beikov 2021-08-09 15:40:23 +02:00
parent 58078aee66
commit b326b303d3
3 changed files with 21 additions and 0 deletions

View File

@ -47,6 +47,13 @@ public class InVmGenerationsWithAnnotationsTests {
assertThat( saved.lastUpdatedOn ).isNotNull();
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
final AuditedEntity merged = scope.fromTransaction( session, (s) -> {

View File

@ -48,6 +48,13 @@ public class InVmGenerationsWithAnnotationsWithMixedSqlTypesTests {
assertThat( saved.lastUpdatedOn ).isNotNull();
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
final AuditedEntity merged = scope.fromTransaction( session, (s) -> {

View File

@ -49,6 +49,13 @@ public class InVmGenerationsWithMultipleAnnotationsTests {
assertThat( saved.lastUpdatedOn ).isNotNull();
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
final AuditedEntity merged = scope.fromTransaction( session, (s) -> {