From 7aaad7e5f455d243c358ae9c84fc6132be1b4a92 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Fri, 10 May 2019 10:35:21 +0900 Subject: [PATCH] Fix assertion for outcomeWhenDevtoolsShouldBeEnabledIsTrueShouldMatch() Closes gh-16815 --- .../autoconfigure/OnEnabledDevToolsConditionTests.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/OnEnabledDevToolsConditionTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/OnEnabledDevToolsConditionTests.java index 2d7a2b5ba3..0df8cb4ee6 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/OnEnabledDevToolsConditionTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/OnEnabledDevToolsConditionTests.java @@ -16,6 +16,8 @@ package org.springframework.boot.devtools.autoconfigure; +import java.util.concurrent.atomic.AtomicBoolean; + import org.junit.Before; import org.junit.Test; @@ -43,13 +45,15 @@ public class OnEnabledDevToolsConditionTests { @Test public void outcomeWhenDevtoolsShouldBeEnabledIsTrueShouldMatch() throws Exception { + AtomicBoolean containsBean = new AtomicBoolean(); Thread thread = new Thread(() -> { OnEnabledDevToolsConditionTests.this.context.refresh(); - assertThat(OnEnabledDevToolsConditionTests.this.context.containsBean("test")) - .isTrue(); + containsBean.set( + OnEnabledDevToolsConditionTests.this.context.containsBean("test")); }); thread.start(); thread.join(); + assertThat(containsBean).isTrue(); } @Test