Skip to content

Commit d1aaee4

Browse files
committed
Merge branch '2.3.x' into 2.4.x
Closes gh-25812
2 parents 4015d70 + c4b84ae commit d1aaee4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfigurationTests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,10 +19,12 @@
1919
import java.io.InputStream;
2020
import java.nio.file.Files;
2121
import java.nio.file.Path;
22+
import java.time.Duration;
2223
import java.util.concurrent.Executor;
2324

2425
import javax.sql.DataSource;
2526

27+
import org.awaitility.Awaitility;
2628
import org.junit.jupiter.api.Test;
2729
import org.junit.jupiter.api.extension.ExtendWith;
2830
import org.junit.jupiter.api.io.TempDir;
@@ -194,8 +196,8 @@ void withConfiguredJobAndTrigger(CapturedOutput output) {
194196
Scheduler scheduler = context.getBean(Scheduler.class);
195197
assertThat(scheduler.getJobDetail(JobKey.jobKey("fooJob"))).isNotNull();
196198
assertThat(scheduler.getTrigger(TriggerKey.triggerKey("fooTrigger"))).isNotNull();
197-
Thread.sleep(1000L);
198-
assertThat(output).contains("withConfiguredJobAndTrigger").contains("jobDataValue");
199+
Awaitility.waitAtMost(Duration.ofSeconds(5)).untilAsserted(
200+
() -> assertThat(output).contains("withConfiguredJobAndTrigger").contains("jobDataValue"));
199201
});
200202
}
201203

0 commit comments

Comments
 (0)