Polish DevToolsEnablementDeducer and OnEnabledDevToolsCondition

See gh-16732
This commit is contained in:
Johnny Lim
2019-05-07 20:26:30 +09:00
committed by Andy Wilkinson
parent ca51609cdf
commit 7c8bf48ebb
8 changed files with 23 additions and 21 deletions

View File

@@ -27,11 +27,11 @@ import org.springframework.context.annotation.Configuration;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link OnEnabledDevtoolsCondition}.
* Tests for {@link OnEnabledDevToolsCondition}.
*
* @author Madhura Bhave
*/
public class OnEnabledDevtoolsConditionTests {
public class OnEnabledDevToolsConditionTests {
private AnnotationConfigApplicationContext context;
@@ -44,8 +44,8 @@ public class OnEnabledDevtoolsConditionTests {
@Test
public void outcomeWhenDevtoolsShouldBeEnabledIsTrueShouldMatch() throws Exception {
Thread thread = new Thread(() -> {
OnEnabledDevtoolsConditionTests.this.context.refresh();
assertThat(OnEnabledDevtoolsConditionTests.this.context.containsBean("test"))
OnEnabledDevToolsConditionTests.this.context.refresh();
assertThat(OnEnabledDevToolsConditionTests.this.context.containsBean("test"))
.isTrue();
});
thread.start();
@@ -54,8 +54,8 @@ public class OnEnabledDevtoolsConditionTests {
@Test
public void outcomeWhenDevtoolsShouldBeEnabledIsFalseShouldNotMatch() {
OnEnabledDevtoolsConditionTests.this.context.refresh();
assertThat(OnEnabledDevtoolsConditionTests.this.context.containsBean("test"))
OnEnabledDevToolsConditionTests.this.context.refresh();
assertThat(OnEnabledDevToolsConditionTests.this.context.containsBean("test"))
.isFalse();
}
@@ -63,7 +63,7 @@ public class OnEnabledDevtoolsConditionTests {
static class TestConfiguration {
@Bean
@Conditional(OnEnabledDevtoolsCondition.class)
@Conditional(OnEnabledDevToolsCondition.class)
public String test() {
return "hello";
}