Browse Source

Merge branch '2.3.x' into 2.4.x

Closes gh-26348
pull/26435/head
Andy Wilkinson 5 years ago
parent
commit
cb1af35dde
  1. 12
      spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/OnInitializedRestarterConditionTests.java

12
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/OnInitializedRestarterConditionTests.java

@ -1,5 +1,5 @@
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 { class OnInitializedRestarterConditionTests {
private static Object wait = new Object();
@BeforeEach @BeforeEach
@AfterEach @AfterEach
void cleanup() { void cleanup() {
@ -67,9 +65,8 @@ class OnInitializedRestarterConditionTests {
void initialized() throws Exception { void initialized() throws Exception {
Thread thread = new Thread(TestInitialized::main); Thread thread = new Thread(TestInitialized::main);
thread.start(); thread.start();
synchronized (wait) { thread.join(30000);
wait.wait(); assertThat(thread.isAlive()).isFalse();
}
} }
static class TestInitialized { static class TestInitialized {
@ -81,9 +78,6 @@ class OnInitializedRestarterConditionTests {
ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(Config.class); ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
assertThat(context.containsBean("bean")).isTrue(); assertThat(context.containsBean("bean")).isTrue();
context.close(); context.close();
synchronized (wait) {
wait.notify();
}
} }
} }

Loading…
Cancel
Save