Commit 7aaad7e5 authored by Johnny Lim's avatar Johnny Lim Committed by Stephane Nicoll

Fix assertion for outcomeWhenDevtoolsShouldBeEnabledIsTrueShouldMatch()

Closes gh-16815
parent 4f4fe014
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
package org.springframework.boot.devtools.autoconfigure; package org.springframework.boot.devtools.autoconfigure;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
...@@ -43,13 +45,15 @@ public class OnEnabledDevToolsConditionTests { ...@@ -43,13 +45,15 @@ public class OnEnabledDevToolsConditionTests {
@Test @Test
public void outcomeWhenDevtoolsShouldBeEnabledIsTrueShouldMatch() throws Exception { public void outcomeWhenDevtoolsShouldBeEnabledIsTrueShouldMatch() throws Exception {
AtomicBoolean containsBean = new AtomicBoolean();
Thread thread = new Thread(() -> { Thread thread = new Thread(() -> {
OnEnabledDevToolsConditionTests.this.context.refresh(); OnEnabledDevToolsConditionTests.this.context.refresh();
assertThat(OnEnabledDevToolsConditionTests.this.context.containsBean("test")) containsBean.set(
.isTrue(); OnEnabledDevToolsConditionTests.this.context.containsBean("test"));
}); });
thread.start(); thread.start();
thread.join(); thread.join();
assertThat(containsBean).isTrue();
} }
@Test @Test
......
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