Skip to content

Commit 7aaad7e

Browse files
izeyesnicoll
authored andcommitted
Fix assertion for outcomeWhenDevtoolsShouldBeEnabledIsTrueShouldMatch()
Closes gh-16815
1 parent 4f4fe01 commit 7aaad7e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/OnEnabledDevToolsConditionTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.boot.devtools.autoconfigure;
1818

19+
import java.util.concurrent.atomic.AtomicBoolean;
20+
1921
import org.junit.Before;
2022
import org.junit.Test;
2123

@@ -43,13 +45,15 @@ public void setup() {
4345

4446
@Test
4547
public void outcomeWhenDevtoolsShouldBeEnabledIsTrueShouldMatch() throws Exception {
48+
AtomicBoolean containsBean = new AtomicBoolean();
4649
Thread thread = new Thread(() -> {
4750
OnEnabledDevToolsConditionTests.this.context.refresh();
48-
assertThat(OnEnabledDevToolsConditionTests.this.context.containsBean("test"))
49-
.isTrue();
51+
containsBean.set(
52+
OnEnabledDevToolsConditionTests.this.context.containsBean("test"));
5053
});
5154
thread.start();
5255
thread.join();
56+
assertThat(containsBean).isTrue();
5357
}
5458

5559
@Test

0 commit comments

Comments
 (0)