Commit cb1af35d authored by Andy Wilkinson's avatar Andy Wilkinson

Merge branch '2.3.x' into 2.4.x

Closes gh-26348
parents dbee0cf9 64408433
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -39,8 +39,6 @@ import static org.mockito.Mockito.mock;
*/
class OnInitializedRestarterConditionTests {
private static Object wait = new Object();
@BeforeEach
@AfterEach
void cleanup() {
......@@ -67,9 +65,8 @@ class OnInitializedRestarterConditionTests {
void initialized() throws Exception {
Thread thread = new Thread(TestInitialized::main);
thread.start();
synchronized (wait) {
wait.wait();
}
thread.join(30000);
assertThat(thread.isAlive()).isFalse();
}
static class TestInitialized {
......@@ -81,9 +78,6 @@ class OnInitializedRestarterConditionTests {
ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
assertThat(context.containsBean("bean")).isTrue();
context.close();
synchronized (wait) {
wait.notify();
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment