Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
c83400d2
Commit
c83400d2
authored
Jul 31, 2013
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move conditions from boot to autoconfigure
Issue: #54393078
parent
4c067a89
Changes
57
Show whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
99 additions
and
245 deletions
+99
-245
AuditAutoConfiguration.java
...mework/boot/ops/autoconfigure/AuditAutoConfiguration.java
+2
-2
EndpointAutoConfiguration.java
...ork/boot/ops/autoconfigure/EndpointAutoConfiguration.java
+1
-1
EndpointWebMvcAutoConfiguration.java
...ot/ops/autoconfigure/EndpointWebMvcAutoConfiguration.java
+2
-2
EndpointWebMvcChildContextConfiguration.java
...utoconfigure/EndpointWebMvcChildContextConfiguration.java
+3
-3
ErrorMvcAutoConfiguration.java
...ork/boot/ops/autoconfigure/ErrorMvcAutoConfiguration.java
+2
-2
ManagementServerPropertiesAutoConfiguration.java
...onfigure/ManagementServerPropertiesAutoConfiguration.java
+1
-1
MetricFilterAutoConfiguration.java
...boot/ops/autoconfigure/MetricFilterAutoConfiguration.java
+2
-2
MetricRepositoryAutoConfiguration.java
.../ops/autoconfigure/MetricRepositoryAutoConfiguration.java
+1
-1
SecurityAutoConfiguration.java
...ork/boot/ops/autoconfigure/SecurityAutoConfiguration.java
+2
-2
TraceRepositoryAutoConfiguration.java
...t/ops/autoconfigure/TraceRepositoryAutoConfiguration.java
+1
-1
TraceWebFilterAutoConfiguration.java
...ot/ops/autoconfigure/TraceWebFilterAutoConfiguration.java
+1
-1
EnableAutoConfiguration.java
...framework/boot/autoconfigure/EnableAutoConfiguration.java
+3
-3
MessageSourceAutoConfiguration.java
...rk/boot/autoconfigure/MessageSourceAutoConfiguration.java
+1
-1
PropertyPlaceholderAutoConfiguration.java
...t/autoconfigure/PropertyPlaceholderAutoConfiguration.java
+1
-1
BatchAutoConfiguration.java
...work/boot/autoconfigure/batch/BatchAutoConfiguration.java
+3
-3
AbstractOnBeanCondition.java
...boot/autoconfigure/condition/AbstractOnBeanCondition.java
+1
-1
ConditionLogUtils.java
...ework/boot/autoconfigure/condition/ConditionLogUtils.java
+1
-1
ConditionalOnBean.java
...ework/boot/autoconfigure/condition/ConditionalOnBean.java
+1
-1
ConditionalOnClass.java
...work/boot/autoconfigure/condition/ConditionalOnClass.java
+1
-1
ConditionalOnExpression.java
...boot/autoconfigure/condition/ConditionalOnExpression.java
+1
-1
ConditionalOnMissingBean.java
...oot/autoconfigure/condition/ConditionalOnMissingBean.java
+1
-1
ConditionalOnMissingClass.java
...ot/autoconfigure/condition/ConditionalOnMissingClass.java
+1
-1
ConditionalOnNotWebApplication.java
...toconfigure/condition/ConditionalOnNotWebApplication.java
+1
-1
ConditionalOnResource.java
...k/boot/autoconfigure/condition/ConditionalOnResource.java
+1
-1
ConditionalOnWebApplication.java
.../autoconfigure/condition/ConditionalOnWebApplication.java
+1
-1
OnBeanCondition.java
...amework/boot/autoconfigure/condition/OnBeanCondition.java
+1
-1
OnClassCondition.java
...mework/boot/autoconfigure/condition/OnClassCondition.java
+1
-1
OnExpressionCondition.java
...k/boot/autoconfigure/condition/OnExpressionCondition.java
+1
-1
OnMissingBeanCondition.java
.../boot/autoconfigure/condition/OnMissingBeanCondition.java
+1
-1
OnMissingClassCondition.java
...boot/autoconfigure/condition/OnMissingClassCondition.java
+1
-1
OnNotWebApplicationCondition.java
...autoconfigure/condition/OnNotWebApplicationCondition.java
+1
-1
OnResourceCondition.java
...ork/boot/autoconfigure/condition/OnResourceCondition.java
+1
-1
OnWebApplicationCondition.java
...ot/autoconfigure/condition/OnWebApplicationCondition.java
+1
-1
SearchStrategy.java
...ramework/boot/autoconfigure/condition/SearchStrategy.java
+1
-1
JpaRepositoriesAutoConfiguration.java
.../autoconfigure/data/JpaRepositoriesAutoConfiguration.java
+2
-2
DataSourceAutoConfiguration.java
.../boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
+3
-3
DataSourceTransactionManagerAutoConfiguration.java
...e/jdbc/DataSourceTransactionManagerAutoConfiguration.java
+3
-3
HibernateJpaAutoConfiguration.java
.../autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java
+1
-1
JpaBaseConfiguration.java
...work/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java
+5
-5
ReactorAutoConfiguration.java
.../boot/autoconfigure/reactor/ReactorAutoConfiguration.java
+2
-2
ThymeleafAutoConfiguration.java
...t/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java
+2
-2
EmbeddedServletContainerAutoConfiguration.java
...figure/web/EmbeddedServletContainerAutoConfiguration.java
+3
-3
MultipartAutoConfiguration.java
...rk/boot/autoconfigure/web/MultipartAutoConfiguration.java
+2
-2
ServerPropertiesAutoConfiguration.java
.../autoconfigure/web/ServerPropertiesAutoConfiguration.java
+1
-1
WebMvcAutoConfiguration.java
...ework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
+3
-3
OnBeanConditionTests.java
...rk/boot/autoconfigure/condition/OnBeanConditionTests.java
+2
-2
OnClassConditionTests.java
...k/boot/autoconfigure/condition/OnClassConditionTests.java
+3
-1
OnExpressionConditionTests.java
...t/autoconfigure/condition/OnExpressionConditionTests.java
+3
-3
OnMissingBeanConditionTests.java
.../autoconfigure/condition/OnMissingBeanConditionTests.java
+4
-4
OnMissingClassConditionTests.java
...autoconfigure/condition/OnMissingClassConditionTests.java
+2
-2
OnNotWebApplicationConditionTests.java
...onfigure/condition/OnNotWebApplicationConditionTests.java
+4
-4
OnResourceConditionTests.java
...oot/autoconfigure/condition/OnResourceConditionTests.java
+3
-3
OnWebApplicationConditionTests.java
...toconfigure/condition/OnWebApplicationConditionTests.java
+4
-4
EmbeddedServletContainerAutoConfigurationTests.java
...e/web/EmbeddedServletContainerAutoConfigurationTests.java
+1
-1
AssertMissingBean.java
...ngframework/boot/context/condition/AssertMissingBean.java
+0
-62
AssertMissingBeanCondition.java
...rk/boot/context/condition/AssertMissingBeanCondition.java
+0
-51
EnableConfigurationPropertiesTests.java
...ontext/properties/EnableConfigurationPropertiesTests.java
+1
-36
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/ops/autoconfigure/AuditAutoConfiguration.java
View file @
c83400d2
...
...
@@ -18,8 +18,8 @@ package org.springframework.boot.ops.autoconfigure;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.ops.audit.AuditEvent
;
import
org.springframework.boot.ops.audit.AuditEventRepository
;
import
org.springframework.boot.ops.audit.InMemoryAuditEventRepository
;
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/ops/autoconfigure/EndpointAutoConfiguration.java
View file @
c83400d2
...
...
@@ -23,8 +23,8 @@ import java.util.Properties;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.bind.PropertiesConfigurationFactory
;
import
org.springframework.boot.context.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.ops.endpoint.BeansEndpoint
;
import
org.springframework.boot.ops.endpoint.DumpEndpoint
;
import
org.springframework.boot.ops.endpoint.Endpoint
;
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/ops/autoconfigure/EndpointWebMvcAutoConfiguration.java
View file @
c83400d2
...
...
@@ -25,10 +25,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration
;
import
org.springframework.boot.context.condition.ConditionalOnClass
;
import
org.springframework.boot.context.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext
;
import
org.springframework.boot.context.embedded.properties.ServerProperties
;
import
org.springframework.boot.ops.endpoint.Endpoint
;
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/ops/autoconfigure/EndpointWebMvcChildContextConfiguration.java
View file @
c83400d2
...
...
@@ -21,9 +21,9 @@ import javax.servlet.Filter;
import
org.springframework.beans.factory.BeanFactory
;
import
org.springframework.beans.factory.HierarchicalBeanFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.
context
.condition.ConditionalOnBean
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
context
.condition.SearchStrategy
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.SearchStrategy
;
import
org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainerFactory
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainer
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer
;
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/ops/autoconfigure/ErrorMvcAutoConfiguration.java
View file @
c83400d2
...
...
@@ -20,8 +20,8 @@ import javax.servlet.Servlet;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainerFactory
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer
;
import
org.springframework.boot.context.embedded.ErrorPage
;
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/ops/autoconfigure/ManagementServerPropertiesAutoConfiguration.java
View file @
c83400d2
...
...
@@ -18,8 +18,8 @@ package org.springframework.boot.ops.autoconfigure;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration
;
import
org.springframework.boot.context.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.ops.properties.ManagementServerProperties
;
import
org.springframework.context.annotation.Bean
;
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/ops/autoconfigure/MetricFilterAutoConfiguration.java
View file @
c83400d2
...
...
@@ -30,8 +30,8 @@ import javax.servlet.http.HttpServletResponse;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnBean
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.boot.ops.metrics.CounterService
;
import
org.springframework.boot.ops.metrics.GaugeService
;
import
org.springframework.context.annotation.Bean
;
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/ops/autoconfigure/MetricRepositoryAutoConfiguration.java
View file @
c83400d2
...
...
@@ -17,7 +17,7 @@
package
org
.
springframework
.
boot
.
ops
.
autoconfigure
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.ops.metrics.CounterService
;
import
org.springframework.boot.ops.metrics.DefaultCounterService
;
import
org.springframework.boot.ops.metrics.DefaultGaugeService
;
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/ops/autoconfigure/SecurityAutoConfiguration.java
View file @
c83400d2
...
...
@@ -22,8 +22,8 @@ import java.util.List;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.ops.endpoint.Endpoint
;
import
org.springframework.boot.ops.endpoint.mvc.EndpointHandlerMapping
;
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/ops/autoconfigure/TraceRepositoryAutoConfiguration.java
View file @
c83400d2
...
...
@@ -17,7 +17,7 @@
package
org
.
springframework
.
boot
.
ops
.
autoconfigure
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.ops.trace.InMemoryTraceRepository
;
import
org.springframework.boot.ops.trace.TraceRepository
;
import
org.springframework.context.annotation.Bean
;
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/ops/autoconfigure/TraceWebFilterAutoConfiguration.java
View file @
c83400d2
...
...
@@ -23,7 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.boot.ops.trace.TraceRepository
;
import
org.springframework.boot.ops.trace.WebRequestTraceFilter
;
import
org.springframework.context.annotation.Bean
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/EnableAutoConfiguration.java
View file @
c83400d2
...
...
@@ -22,9 +22,9 @@ import java.lang.annotation.Retention;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
import
org.springframework.boot.
context
.condition.ConditionalOnBean
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainerFactory
;
import
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory
;
import
org.springframework.context.annotation.Conditional
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java
View file @
c83400d2
...
...
@@ -17,7 +17,7 @@
package
org
.
springframework
.
boot
.
autoconfigure
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.context.MessageSource
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/PropertyPlaceholderAutoConfiguration.java
View file @
c83400d2
...
...
@@ -16,7 +16,7 @@
package
org
.
springframework
.
boot
.
autoconfigure
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.java
View file @
c83400d2
...
...
@@ -20,9 +20,9 @@ import org.springframework.batch.core.launch.JobLauncher;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.boot.ExitCodeGenerator
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnBean
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/AbstractOnBeanCondition.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/AbstractOnBeanCondition.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/ConditionLogUtils.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/ConditionLogUtils.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.apache.commons.logging.Log
;
import
org.springframework.core.type.AnnotatedTypeMetadata
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/ConditionalOnBean.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/ConditionalOnBean.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.lang.annotation.Documented
;
import
java.lang.annotation.ElementType
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/ConditionalOnClass.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/ConditionalOnClass.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.lang.annotation.Documented
;
import
java.lang.annotation.ElementType
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/ConditionalOnExpression.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/ConditionalOnExpression.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/ConditionalOnMissingBean.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/ConditionalOnMissingBean.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.lang.annotation.Documented
;
import
java.lang.annotation.ElementType
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/ConditionalOnMissingClass.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/ConditionalOnMissingClass.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.lang.annotation.Documented
;
import
java.lang.annotation.ElementType
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/ConditionalOnNotWebApplication.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/ConditionalOnNotWebApplication.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.lang.annotation.Documented
;
import
java.lang.annotation.ElementType
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/ConditionalOnResource.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/ConditionalOnResource.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.lang.annotation.Documented
;
import
java.lang.annotation.ElementType
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/ConditionalOnWebApplication.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/ConditionalOnWebApplication.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.lang.annotation.Documented
;
import
java.lang.annotation.ElementType
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/OnBeanCondition.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/OnBeanCondition.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.springframework.context.annotation.Condition
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/OnClassCondition.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/OnClassCondition.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/OnExpressionCondition.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/OnExpressionCondition.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/OnMissingBeanCondition.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/OnMissingBeanCondition.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.util.List
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/OnMissingClassCondition.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/OnMissingClassCondition.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/OnNotWebApplicationCondition.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/OnNotWebApplicationCondition.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/OnResourceCondition.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/OnResourceCondition.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/OnWebApplicationCondition.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/OnWebApplicationCondition.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
...
...
spring-boot
/src/main/java/org/springframework/boot/context
/condition/SearchStrategy.java
→
spring-boot
-autoconfigure/src/main/java/org/springframework/boot/autoconfigure
/condition/SearchStrategy.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
/**
* Some named search strategies for beans in the bean factory hierarchy.
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/JpaRepositoriesAutoConfiguration.java
View file @
c83400d2
...
...
@@ -17,8 +17,8 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
data
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.data.jpa.repository.JpaRepository
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
View file @
c83400d2
...
...
@@ -29,9 +29,9 @@ import org.springframework.beans.factory.BeanFactoryUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionLogUtils
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionLogUtils
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Condition
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfiguration.java
View file @
c83400d2
...
...
@@ -20,9 +20,9 @@ import javax.sql.DataSource;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnBean
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.Ordered
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java
View file @
c83400d2
...
...
@@ -22,7 +22,7 @@ import java.util.Map;
import
org.hibernate.ejb.HibernateEntityManager
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java
View file @
c83400d2
...
...
@@ -29,12 +29,12 @@ import org.springframework.beans.factory.config.BeanDefinition;
import
org.springframework.beans.factory.config.ConfigurableListableBeanFactory
;
import
org.springframework.boot.autoconfigure.AutoConfigurationUtils
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnExpression
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.autoconfigure.jdbc.EmbeddedDatabaseConfiguration
;
import
org.springframework.boot.context.condition.ConditionalOnBean
;
import
org.springframework.boot.context.condition.ConditionalOnClass
;
import
org.springframework.boot.context.condition.ConditionalOnExpression
;
import
org.springframework.boot.context.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.context.condition.ConditionalOnWebApplication
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.orm.jpa.JpaTransactionManager
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfiguration.java
View file @
c83400d2
...
...
@@ -17,9 +17,9 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
reactor
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration
;
import
org.springframework.boot.context.condition.ConditionalOnClass
;
import
org.springframework.boot.context.condition.ConditionalOnMissingBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.Ordered
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java
View file @
c83400d2
...
...
@@ -29,9 +29,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration
;
import
org.springframework.boot.context.condition.ConditionalOnClass
;
import
org.springframework.boot.context.condition.ConditionalOnMissingBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.io.DefaultResourceLoader
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration.java
View file @
c83400d2
...
...
@@ -29,10 +29,10 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import
org.springframework.beans.factory.support.BeanDefinitionRegistry
;
import
org.springframework.beans.factory.support.RootBeanDefinition
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.SearchStrategy
;
import
org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration.EmbeddedServletContainerCustomizerBeanPostProcessorRegistrar
;
import
org.springframework.boot.context.condition.ConditionalOnClass
;
import
org.springframework.boot.context.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.context.condition.SearchStrategy
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizerBeanPostProcessor
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainerFactory
;
import
org.springframework.boot.context.embedded.ServletContextInitializer
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/MultipartAutoConfiguration.java
View file @
c83400d2
...
...
@@ -20,8 +20,8 @@ import javax.servlet.MultipartConfigElement;
import
javax.servlet.Servlet
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnBean
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.java
View file @
c83400d2
...
...
@@ -18,7 +18,7 @@ package org.springframework.boot.autoconfigure.web;
import
org.springframework.beans.BeansException
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainerFactory
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer
;
import
org.springframework.boot.context.embedded.properties.ServerProperties
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
View file @
c83400d2
...
...
@@ -27,9 +27,9 @@ import org.springframework.beans.factory.ListableBeanFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.
context
.condition.ConditionalOnBean
;
import
org.springframework.boot.
context
.condition.ConditionalOnClass
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnClass
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.Ordered
;
...
...
spring-boot
/src/test/java/org/springframework/boot/context
/condition/OnBeanConditionTests.java
→
spring-boot
-autoconfigure/src/test/java/org/springframework/boot/autoconfigure
/condition/OnBeanConditionTests.java
View file @
c83400d2
...
...
@@ -14,11 +14,11 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.springframework.boot.
context
.condition.ConditionalOnBean
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnBean
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot
/src/test/java/org/springframework/boot/context
/condition/OnClassConditionTests.java
→
spring-boot
-autoconfigure/src/test/java/org/springframework/boot/autoconfigure
/condition/OnClassConditionTests.java
View file @
c83400d2
...
...
@@ -14,9 +14,11 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.junit.Test
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.OnClassCondition
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot
/src/test/java/org/springframework/boot/context
/condition/OnExpressionConditionTests.java
→
spring-boot
-autoconfigure/src/test/java/org/springframework/boot/autoconfigure
/condition/OnExpressionConditionTests.java
View file @
c83400d2
...
...
@@ -14,11 +14,11 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.junit.Test
;
import
org.springframework.boot.
context
.condition.ConditionalOnExpression
;
import
org.springframework.boot.
context
.condition.OnExpressionCondition
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnExpression
;
import
org.springframework.boot.
autoconfigure
.condition.OnExpressionCondition
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot
/src/test/java/org/springframework/boot/context
/condition/OnMissingBeanConditionTests.java
→
spring-boot
-autoconfigure/src/test/java/org/springframework/boot/autoconfigure
/condition/OnMissingBeanConditionTests.java
View file @
c83400d2
...
...
@@ -14,12 +14,12 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.junit.Test
;
import
org.springframework.boot.
context
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
context
.condition.OnMissingBeanCondition
;
import
org.springframework.boot.
context
.condition.SearchStrategy
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.
autoconfigure
.condition.OnMissingBeanCondition
;
import
org.springframework.boot.
autoconfigure
.condition.SearchStrategy
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot
/src/test/java/org/springframework/boot/context
/condition/OnMissingClassConditionTests.java
→
spring-boot
-autoconfigure/src/test/java/org/springframework/boot/autoconfigure
/condition/OnMissingClassConditionTests.java
View file @
c83400d2
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.junit.Test
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
...
...
@@ -51,7 +51,7 @@ public class OnMissingClassConditionTests {
}
@Configuration
@ConditionalOnMissingClass
(
"org.springframework.boot.
context
.condition.OnMissingClassConditionTests"
)
@ConditionalOnMissingClass
(
"org.springframework.boot.
autoconfigure
.condition.OnMissingClassConditionTests"
)
protected
static
class
BasicConfiguration
{
@Bean
public
String
bar
()
{
...
...
spring-boot
/src/test/java/org/springframework/boot/context
/condition/OnNotWebApplicationConditionTests.java
→
spring-boot
-autoconfigure/src/test/java/org/springframework/boot/autoconfigure
/condition/OnNotWebApplicationConditionTests.java
View file @
c83400d2
...
...
@@ -14,12 +14,12 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.junit.Test
;
import
org.springframework.boot.
context
.condition.ConditionalOnNotWebApplication
;
import
org.springframework.boot.
context
.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.
context
.condition.OnNotWebApplicationCondition
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnNotWebApplication
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.
autoconfigure
.condition.OnNotWebApplicationCondition
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot
/src/test/java/org/springframework/boot/context
/condition/OnResourceConditionTests.java
→
spring-boot
-autoconfigure/src/test/java/org/springframework/boot/autoconfigure
/condition/OnResourceConditionTests.java
View file @
c83400d2
...
...
@@ -14,11 +14,11 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.junit.Test
;
import
org.springframework.boot.
context
.condition.ConditionalOnResource
;
import
org.springframework.boot.
context
.condition.OnResourceCondition
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnResource
;
import
org.springframework.boot.
autoconfigure
.condition.OnResourceCondition
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
spring-boot
/src/test/java/org/springframework/boot/context
/condition/OnWebApplicationConditionTests.java
→
spring-boot
-autoconfigure/src/test/java/org/springframework/boot/autoconfigure
/condition/OnWebApplicationConditionTests.java
View file @
c83400d2
...
...
@@ -14,12 +14,12 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
package
org
.
springframework
.
boot
.
autoconfigure
.
condition
;
import
org.junit.Test
;
import
org.springframework.boot.
context
.condition.ConditionalOnNotWebApplication
;
import
org.springframework.boot.
context
.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.
context
.condition.OnWebApplicationCondition
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnNotWebApplication
;
import
org.springframework.boot.
autoconfigure
.condition.ConditionalOnWebApplication
;
import
org.springframework.boot.
autoconfigure
.condition.OnWebApplicationCondition
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.mock.web.MockServletContext
;
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfigurationTests.java
View file @
c83400d2
...
...
@@ -21,8 +21,8 @@ import javax.servlet.Servlet;
import
org.junit.Test
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.config.BeanPostProcessor
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnExpression
;
import
org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration
;
import
org.springframework.boot.context.condition.ConditionalOnExpression
;
import
org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext
;
import
org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainerFactory
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer
;
...
...
spring-boot/src/test/java/org/springframework/boot/context/condition/AssertMissingBean.java
deleted
100644 → 0
View file @
4c067a89
/*
* Copyright 2012-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
import
java.lang.annotation.Documented
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
import
org.springframework.beans.factory.BeanFactory
;
import
org.springframework.boot.context.condition.ConditionalOnMissingBean
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.annotation.Conditional
;
/**
* {@link Conditional} that only matches when the specified bean classes and/or names are
* not already contained in the {@link BeanFactory}, and throws an exception otherwise.
*
* @author Dave Syer
* @see ConditionalOnMissingBean
*/
@Target
({
ElementType
.
TYPE
,
ElementType
.
METHOD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
@Conditional
(
AssertMissingBeanCondition
.
class
)
public
@interface
AssertMissingBean
{
/**
* The class type of bean that should be checked. The condition matches when each
* class specified is missing in the {@link ApplicationContext}.
* @return the class types of beans to check
*/
Class
<?>[]
value
()
default
{};
/**
* The names of beans to check. The condition matches when each bean name specified is
* missing in the {@link ApplicationContext}.
* @return the name of beans to check
*/
String
[]
name
()
default
{};
/**
* If the application context hierarchy (parent contexts) should be considered.
*/
boolean
considerHierarchy
()
default
true
;
}
spring-boot/src/test/java/org/springframework/boot/context/condition/AssertMissingBeanCondition.java
deleted
100644 → 0
View file @
4c067a89
/*
* Copyright 2012-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
context
.
condition
;
import
java.util.List
;
import
org.springframework.beans.factory.BeanCreationException
;
import
org.springframework.boot.context.condition.OnMissingBeanCondition
;
import
org.springframework.context.annotation.Condition
;
import
org.springframework.context.annotation.ConditionContext
;
import
org.springframework.core.type.AnnotatedTypeMetadata
;
/**
* {@link Condition} that checks that specific beans are missing.
*
* @author Dave Syer
* @see AssertMissingBean
*/
class
AssertMissingBeanCondition
extends
OnMissingBeanCondition
{
@Override
protected
Class
<?>
annotationClass
()
{
return
AssertMissingBean
.
class
;
}
@Override
protected
boolean
matches
(
ConditionContext
context
,
AnnotatedTypeMetadata
metadata
,
List
<
String
>
beanClasses
,
List
<
String
>
beanNames
)
throws
LinkageError
{
boolean
result
=
super
.
matches
(
context
,
metadata
,
beanClasses
,
beanNames
);
if
(!
result
)
{
throw
new
BeanCreationException
(
"Found existing bean for classes="
+
beanClasses
+
" and names="
+
beanNames
);
}
return
result
;
}
}
spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java
View file @
c83400d2
...
...
@@ -23,11 +23,8 @@ import java.util.List;
import
javax.annotation.PostConstruct
;
import
org.junit.Test
;
import
org.springframework.beans.factory.BeanCreationException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.TestUtils
;
import
org.springframework.boot.context.condition.AssertMissingBean
;
import
org.springframework.boot.context.condition.ConditionalOnMissingBean
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -90,30 +87,9 @@ public class EnableConfigurationPropertiesTests {
assertEquals
(
"bar"
,
this
.
context
.
getBean
(
TestProperties
.
class
).
getName
());
}
@Test
(
expected
=
BeanCreationException
.
class
)
public
void
testPropertiesBindingWithDefaultsInBeanMethodReverseOrder
()
{
this
.
context
.
register
(
TestBeanConfiguration
.
class
,
DefaultConfiguration
.
class
);
this
.
context
.
refresh
();
String
[]
beanNames
=
this
.
context
.
getBeanNamesForType
(
TestProperties
.
class
);
assertEquals
(
"Wrong beans: "
+
Arrays
.
asList
(
beanNames
),
1
,
beanNames
.
length
);
assertEquals
(
"bar"
,
this
.
context
.
getBean
(
TestProperties
.
class
).
getName
());
}
@Test
public
void
testPropertiesBindingWithDefaultsInBeanMethod
()
{
this
.
context
.
register
(
DefaultConfiguration
.
class
,
TestBeanConfiguration
.
class
);
this
.
context
.
refresh
();
String
[]
beanNames
=
this
.
context
.
getBeanNamesForType
(
TestProperties
.
class
);
assertEquals
(
"Wrong beans: "
+
Arrays
.
asList
(
beanNames
),
1
,
beanNames
.
length
);
assertEquals
(
"bar"
,
this
.
context
.
getBean
(
TestProperties
.
class
).
getName
());
}
// Maybe we could relax the condition that causes this exception but Spring makes it
// difficult because it is impossible for DefaultConfiguration to override a bean
// definition created with a direct registration (as opposed to a @Bean)
@Test
(
expected
=
BeanCreationException
.
class
)
public
void
testPropertiesBindingWithDefaults
()
{
this
.
context
.
register
(
TestConfiguration
.
class
,
DefaultConfiguration
.
class
);
this
.
context
.
register
(
DefaultConfiguration
.
class
);
this
.
context
.
refresh
();
String
[]
beanNames
=
this
.
context
.
getBeanNamesForType
(
TestProperties
.
class
);
assertEquals
(
"Wrong beans: "
+
Arrays
.
asList
(
beanNames
),
1
,
beanNames
.
length
);
...
...
@@ -204,20 +180,9 @@ public class EnableConfigurationPropertiesTests {
protected
static
class
TestConfiguration
{
}
@Configuration
@EnableConfigurationProperties
protected
static
class
TestBeanConfiguration
{
@ConditionalOnMissingBean
(
TestProperties
.
class
)
@Bean
(
name
=
"org.springframework.boot.context.annotation.EnableConfigurationPropertiesTests$TestProperties"
)
public
TestProperties
testProperties
()
{
return
new
TestProperties
();
}
}
@Configuration
protected
static
class
DefaultConfiguration
{
@Bean
@AssertMissingBean
(
TestProperties
.
class
)
public
TestProperties
testProperties
()
{
TestProperties
test
=
new
TestProperties
();
test
.
setName
(
"bar"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment