Skip to content

Commit 60494a6

Browse files
committed
DATAMONGO-800 - Improved AuditingIntegrationTests.
Added a tiny Thread.sleep(…) to make sure the assertion works on fast machines. If the operations after the first step all happen within a millisecond, it will fail.
1 parent ceb561e commit 60494a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/config/AuditingIntegrationTests.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
public class AuditingIntegrationTests {
3636

3737
@Test
38-
public void enablesAuditingAndSetsPropertiesAccordingly() {
38+
public void enablesAuditingAndSetsPropertiesAccordingly() throws Exception {
3939

4040
AbstractApplicationContext context = new ClassPathXmlApplicationContext("auditing.xml", getClass());
4141

@@ -46,6 +46,7 @@ public void enablesAuditingAndSetsPropertiesAccordingly() {
4646
assertThat(entity.created, is(notNullValue()));
4747
assertThat(entity.modified, is(entity.created));
4848

49+
Thread.sleep(10);
4950
entity.id = 1L;
5051
event = new BeforeConvertEvent<Entity>(entity);
5152
context.publishEvent(event);

0 commit comments

Comments
 (0)