From 42bf594d96601d859da666f74c18fd18d275525c Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 3 Sep 2018 12:16:18 +0200 Subject: [PATCH] Polish condition name See gh-14285 --- ...ListCondition.java => OnPropertyListCondition.java} | 4 ++-- .../couchbase/OnBootstrapHostsCondition.java | 4 ++-- .../webservices/OnWsdlLocationsCondition.java | 4 ++-- ...ionTests.java => OnPropertyListConditionTests.java} | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) rename spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/{OnListCondition.java => OnPropertyListCondition.java} (95%) rename spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/{OnListConditionTests.java => OnPropertyListConditionTests.java} (90%) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnListCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyListCondition.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnListCondition.java rename to spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyListCondition.java index 78eae1aa0b..db74d4ff7e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnListCondition.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyListCondition.java @@ -34,7 +34,7 @@ import org.springframework.core.type.AnnotatedTypeMetadata; * @author Stephane Nicoll * @since 2.0.5 */ -public class OnListCondition extends SpringBootCondition { +public class OnPropertyListCondition extends SpringBootCondition { private static final Bindable> SIMPLE_LIST = Bindable .listOf(String.class); @@ -49,7 +49,7 @@ public class OnListCondition extends SpringBootCondition { * @param messageBuilder a message builder supplier that should provide a fresh * instance on each call */ - protected OnListCondition(String propertyName, + protected OnPropertyListCondition(String propertyName, Supplier messageBuilder) { this.propertyName = propertyName; this.messageBuilder = messageBuilder; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/OnBootstrapHostsCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/OnBootstrapHostsCondition.java index b4a9724092..d57fcd9b99 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/OnBootstrapHostsCondition.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/OnBootstrapHostsCondition.java @@ -17,7 +17,7 @@ package org.springframework.boot.autoconfigure.couchbase; import org.springframework.boot.autoconfigure.condition.ConditionMessage; -import org.springframework.boot.autoconfigure.condition.OnListCondition; +import org.springframework.boot.autoconfigure.condition.OnPropertyListCondition; /** * Condition to determine if {@code spring.couchbase.bootstrap-hosts} is specified. @@ -26,7 +26,7 @@ import org.springframework.boot.autoconfigure.condition.OnListCondition; * @author Madhura Bhave * @author Eneias Silva */ -class OnBootstrapHostsCondition extends OnListCondition { +class OnBootstrapHostsCondition extends OnPropertyListCondition { OnBootstrapHostsCondition() { super("spring.couchbase.bootstrap-hosts", diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/OnWsdlLocationsCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/OnWsdlLocationsCondition.java index 8ebcaba16d..7d366a15fc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/OnWsdlLocationsCondition.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/OnWsdlLocationsCondition.java @@ -17,7 +17,7 @@ package org.springframework.boot.autoconfigure.webservices; import org.springframework.boot.autoconfigure.condition.ConditionMessage; -import org.springframework.boot.autoconfigure.condition.OnListCondition; +import org.springframework.boot.autoconfigure.condition.OnPropertyListCondition; /** * Condition to determine if {@code spring.webservices.wsdl-locations} is specified. @@ -25,7 +25,7 @@ import org.springframework.boot.autoconfigure.condition.OnListCondition; * @author Eneias Silva * @author Stephane Nicoll */ -class OnWsdlLocationsCondition extends OnListCondition { +class OnWsdlLocationsCondition extends OnPropertyListCondition { OnWsdlLocationsCondition() { super("spring.webservices.wsdl-locations", diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnListConditionTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnPropertyListConditionTests.java similarity index 90% rename from spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnListConditionTests.java rename to spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnPropertyListConditionTests.java index 27d4ac66b6..8794881f8d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnListConditionTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/OnPropertyListConditionTests.java @@ -26,11 +26,11 @@ import org.springframework.context.annotation.Configuration; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link OnListCondition}. + * Tests for {@link OnPropertyListCondition}. * * @author Stephane Nicoll */ -public class OnListConditionTests { +public class OnPropertyListConditionTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withUserConfiguration(TestConfig.class); @@ -65,7 +65,7 @@ public class OnListConditionTests { } @Configuration - @Conditional(TestListCondition.class) + @Conditional(TestPropertyListCondition.class) protected static class TestConfig { @Bean @@ -75,9 +75,9 @@ public class OnListConditionTests { } - static class TestListCondition extends OnListCondition { + static class TestPropertyListCondition extends OnPropertyListCondition { - TestListCondition() { + TestPropertyListCondition() { super("spring.test.my-list", () -> ConditionMessage.forCondition("test")); }