Setup Awaitility to poll on the same thread by default
@@ -2,8 +2,6 @@ package junit5.support;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
import org.awaitility.Awaitility;
import org.junit.jupiter.api.extension.BeforeAllCallback;
@@ -14,13 +12,11 @@ import org.junit.jupiter.api.extension.ExtensionContext;
*/
public class AwaitilityConfigurationExtension implements BeforeAllCallback {
- private static final ExecutorService POOL = Executors.newCachedThreadPool();
-
@Override
public void beforeAll(ExtensionContext extensionContext) {
Awaitility.catchUncaughtExceptionsByDefault();
Awaitility.setDefaultPollInterval(Duration.of(200, ChronoUnit.MILLIS));
Awaitility.setDefaultPollDelay(Duration.of(50, ChronoUnit.MILLIS));
- Awaitility.pollExecutorService(POOL);
+ Awaitility.pollInSameThread();
}
}
