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
0c79c891
Commit
0c79c891
authored
Nov 04, 2013
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure AutoConfigurationReport is always present
parent
b63016d8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
108 additions
and
29 deletions
+108
-29
AutoConfigurationReportEndpoint.java
...oot/actuate/endpoint/AutoConfigurationReportEndpoint.java
+4
-3
EndpointAutoConfigurationTests.java
...actuate/autoconfigure/EndpointAutoConfigurationTests.java
+3
-3
AutoConfigurationReportEndpointTests.java
...ctuate/endpoint/AutoConfigurationReportEndpointTests.java
+11
-6
AutoConfigurationReport.java
...rk/boot/autoconfigure/report/AutoConfigurationReport.java
+19
-1
AutoConfigurationReportApplicationContextInitializer.java
...AutoConfigurationReportApplicationContextInitializer.java
+48
-0
spring.factories
...utoconfigure/src/main/resources/META-INF/spring.factories
+2
-0
AutoConfigurationReportTests.java
...work/boot/autoconfigure/AutoConfigurationReportTests.java
+21
-14
SampleSecureApplication.java
...framework/boot/sample/ops/ui/SampleSecureApplication.java
+0
-2
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpoint.java
View file @
0c79c891
...
@@ -22,17 +22,18 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
...
@@ -22,17 +22,18 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
/**
/**
* Endpoint to serve up autoconfiguration report if actuator is on the classpath.
* Endpoint to serve up autoconfiguration report if actuator is on the classpath.
*
*
* @author Greg Turnquist
* @author Greg Turnquist
*/
*/
@ConfigurationProperties
(
name
=
"endpoints.autoconfigurationreport"
,
ignoreUnknownFields
=
false
)
@ConfigurationProperties
(
name
=
"endpoints.autoconfigurationreport"
,
ignoreUnknownFields
=
false
)
public
class
AutoConfigurationReportEndpoint
extends
AbstractEndpoint
<
AutoConfigurationReport
>
{
public
class
AutoConfigurationReportEndpoint
extends
AbstractEndpoint
<
AutoConfigurationReport
>
{
@Autowired
@Autowired
private
AutoConfigurationReport
autoConfigurationReport
;
private
AutoConfigurationReport
autoConfigurationReport
;
public
AutoConfigurationReportEndpoint
()
{
public
AutoConfigurationReportEndpoint
()
{
super
(
"/auto
configurationreport
"
);
super
(
"/auto"
);
}
}
@Override
@Override
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointAutoConfigurationTests.java
View file @
0c79c891
...
@@ -29,7 +29,7 @@ import org.springframework.boot.actuate.endpoint.InfoEndpoint;
...
@@ -29,7 +29,7 @@ import org.springframework.boot.actuate.endpoint.InfoEndpoint;
import
org.springframework.boot.actuate.endpoint.MetricsEndpoint
;
import
org.springframework.boot.actuate.endpoint.MetricsEndpoint
;
import
org.springframework.boot.actuate.endpoint.ShutdownEndpoint
;
import
org.springframework.boot.actuate.endpoint.ShutdownEndpoint
;
import
org.springframework.boot.actuate.endpoint.TraceEndpoint
;
import
org.springframework.boot.actuate.endpoint.TraceEndpoint
;
import
org.springframework.boot.autoconfigure.report.AutoConfigurationReport
Creator
;
import
org.springframework.boot.autoconfigure.report.AutoConfigurationReport
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
...
@@ -74,12 +74,12 @@ public class EndpointAutoConfigurationTests {
...
@@ -74,12 +74,12 @@ public class EndpointAutoConfigurationTests {
@Test
@Test
public
void
autoconfigurationAuditEndpoints
()
{
public
void
autoconfigurationAuditEndpoints
()
{
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
.
register
(
EndpointAutoConfiguration
.
class
,
AutoConfigurationReportCreator
.
class
);
this
.
context
.
register
(
EndpointAutoConfiguration
.
class
,
AutoConfigurationReport
.
class
);
this
.
context
.
refresh
();
this
.
context
.
refresh
();
assertNotNull
(
this
.
context
.
getBean
(
AutoConfigurationReportEndpoint
.
class
));
assertNotNull
(
this
.
context
.
getBean
(
AutoConfigurationReportEndpoint
.
class
));
}
}
@Test
@Test
public
void
testInfoEndpointConfiguration
()
throws
Exception
{
public
void
testInfoEndpointConfiguration
()
throws
Exception
{
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
=
new
AnnotationConfigApplicationContext
();
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpointTests.java
View file @
0c79c891
...
@@ -16,28 +16,33 @@
...
@@ -16,28 +16,33 @@
package
org
.
springframework
.
boot
.
actuate
.
endpoint
;
package
org
.
springframework
.
boot
.
actuate
.
endpoint
;
import
org.springframework.boot.autoconfigure.report.
Enable
AutoConfigurationReport
;
import
org.springframework.boot.autoconfigure.report.AutoConfigurationReport
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
/**
/**
* Tests for {@link AutoConfigurationReportEndpoint}.
* Tests for {@link AutoConfigurationReportEndpoint}.
*
*
* @author Greg Turnquist
* @author Greg Turnquist
*/
*/
public
class
AutoConfigurationReportEndpointTests
extends
AbstractEndpointTests
<
AutoConfigurationReportEndpoint
>
{
public
class
AutoConfigurationReportEndpointTests
extends
AbstractEndpointTests
<
AutoConfigurationReportEndpoint
>
{
public
AutoConfigurationReportEndpointTests
()
{
public
AutoConfigurationReportEndpointTests
()
{
super
(
Config
.
class
,
AutoConfigurationReportEndpoint
.
class
,
super
(
Config
.
class
,
AutoConfigurationReportEndpoint
.
class
,
"/auto"
,
true
,
"
/autoconfigurationreport"
,
true
,
"
endpoints.autoconfigurationreport"
);
"endpoints.autoconfigurationreport"
);
}
}
@Configuration
@Configuration
@EnableConfigurationProperties
@EnableConfigurationProperties
@EnableAutoConfigurationReport
public
static
class
Config
{
public
static
class
Config
{
@Bean
public
AutoConfigurationReport
autoConfigurationReport
()
{
return
new
AutoConfigurationReport
();
}
@Bean
@Bean
public
AutoConfigurationReportEndpoint
endpoint
()
{
public
AutoConfigurationReportEndpoint
endpoint
()
{
return
new
AutoConfigurationReportEndpoint
();
return
new
AutoConfigurationReportEndpoint
();
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/report/AutoConfigurationReport.java
View file @
0c79c891
...
@@ -28,10 +28,12 @@ import java.util.Set;
...
@@ -28,10 +28,12 @@ import java.util.Set;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.config.ConfigurableListableBeanFactory
;
import
org.springframework.boot.autoconfigure.condition.Outcome
;
import
org.springframework.boot.autoconfigure.condition.Outcome
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.ConditionContext
;
import
org.springframework.context.annotation.ConditionContext
;
import
org.springframework.context.event.ContextRefreshedEvent
;
import
org.springframework.context.event.ContextRefreshedEvent
;
...
@@ -46,6 +48,8 @@ import org.springframework.context.event.ContextRefreshedEvent;
...
@@ -46,6 +48,8 @@ import org.springframework.context.event.ContextRefreshedEvent;
public
class
AutoConfigurationReport
implements
ApplicationContextAware
,
public
class
AutoConfigurationReport
implements
ApplicationContextAware
,
ApplicationListener
<
ContextRefreshedEvent
>
{
ApplicationListener
<
ContextRefreshedEvent
>
{
private
static
final
String
AUTO_CONFIGURATION_REPORT
=
"autoConfigurationReport"
;
private
static
Log
logger
=
LogFactory
.
getLog
(
AutoConfigurationReport
.
class
);
private
static
Log
logger
=
LogFactory
.
getLog
(
AutoConfigurationReport
.
class
);
private
Set
<
CreatedBeanInfo
>
beansCreated
=
new
LinkedHashSet
<
CreatedBeanInfo
>();
private
Set
<
CreatedBeanInfo
>
beansCreated
=
new
LinkedHashSet
<
CreatedBeanInfo
>();
...
@@ -57,13 +61,27 @@ public class AutoConfigurationReport implements ApplicationContextAware,
...
@@ -57,13 +61,27 @@ public class AutoConfigurationReport implements ApplicationContextAware,
public
static
void
registerDecision
(
ConditionContext
context
,
String
message
,
public
static
void
registerDecision
(
ConditionContext
context
,
String
message
,
String
classOrMethodName
,
Outcome
outcome
)
{
String
classOrMethodName
,
Outcome
outcome
)
{
if
(
context
.
getBeanFactory
().
containsBeanDefinition
(
"autoConfigurationReport"
))
{
if
(
context
.
getBeanFactory
().
containsBeanDefinition
(
AUTO_CONFIGURATION_REPORT
)
||
context
.
getBeanFactory
().
containsSingleton
(
AUTO_CONFIGURATION_REPORT
))
{
AutoConfigurationReport
autoconfigurationReport
=
context
.
getBeanFactory
()
AutoConfigurationReport
autoconfigurationReport
=
context
.
getBeanFactory
()
.
getBean
(
AutoConfigurationReport
.
class
);
.
getBean
(
AutoConfigurationReport
.
class
);
autoconfigurationReport
.
registerDecision
(
message
,
classOrMethodName
,
outcome
);
autoconfigurationReport
.
registerDecision
(
message
,
classOrMethodName
,
outcome
);
}
}
}
}
public
static
AutoConfigurationReport
registerReport
(
ConfigurableApplicationContext
applicationContext
,
ConfigurableListableBeanFactory
beanFactory
)
{
if
(!
beanFactory
.
containsBean
(
AutoConfigurationReport
.
AUTO_CONFIGURATION_REPORT
))
{
AutoConfigurationReport
report
=
new
AutoConfigurationReport
();
report
.
setApplicationContext
(
applicationContext
);
beanFactory
.
registerSingleton
(
AutoConfigurationReport
.
AUTO_CONFIGURATION_REPORT
,
report
);
}
return
beanFactory
.
getBean
(
AutoConfigurationReport
.
AUTO_CONFIGURATION_REPORT
,
AutoConfigurationReport
.
class
);
}
private
void
registerDecision
(
String
message
,
String
classOrMethodName
,
private
void
registerDecision
(
String
message
,
String
classOrMethodName
,
Outcome
outcome
)
{
Outcome
outcome
)
{
AutoConfigurationDecision
decision
=
new
AutoConfigurationDecision
(
message
,
AutoConfigurationDecision
decision
=
new
AutoConfigurationDecision
(
message
,
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/report/AutoConfigurationReportApplicationContextInitializer.java
0 → 100644
View file @
0c79c891
/*
* 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
.
autoconfigure
.
report
;
import
org.springframework.beans.factory.config.ConfigurableListableBeanFactory
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplicationErrorHandler
;
import
org.springframework.context.ApplicationContextInitializer
;
import
org.springframework.context.ConfigurableApplicationContext
;
/**
* @author Dave Syer
*/
public
class
AutoConfigurationReportApplicationContextInitializer
implements
ApplicationContextInitializer
<
ConfigurableApplicationContext
>,
SpringApplicationErrorHandler
{
private
AutoConfigurationReport
report
;
@Override
public
void
initialize
(
ConfigurableApplicationContext
applicationContext
)
{
ConfigurableListableBeanFactory
beanFactory
=
applicationContext
.
getBeanFactory
();
this
.
report
=
AutoConfigurationReport
.
registerReport
(
applicationContext
,
beanFactory
);
}
@Override
public
void
handle
(
SpringApplication
springApplication
,
String
[]
args
,
Throwable
e
)
{
if
(
this
.
report
!=
null
)
{
this
.
report
.
initialize
();
// salvage a report if possible
}
}
}
spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories
View file @
0c79c891
...
@@ -20,3 +20,5 @@ org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration,\
...
@@ -20,3 +20,5 @@ org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration,\
org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration,\
org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration,\
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration,\
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration,\
org.springframework.boot.autoconfigure.websocket.WebSocketAutoConfiguration
org.springframework.boot.autoconfigure.websocket.WebSocketAutoConfiguration
org.springframework.context.ApplicationContextInitializer=\
org.springframework.boot.autoconfigure.report.AutoConfigurationReportApplicationContextInitializer
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationReportTests.java
View file @
0c79c891
...
@@ -16,9 +16,6 @@
...
@@ -16,9 +16,6 @@
package
org
.
springframework
.
boot
.
autoconfigure
;
package
org
.
springframework
.
boot
.
autoconfigure
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
...
@@ -30,8 +27,8 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
...
@@ -30,8 +27,8 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
import
org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration
;
import
org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jms.JmsTemplateAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jms.JmsTemplateAutoConfiguration
;
import
org.springframework.boot.autoconfigure.report.AutoConfigurationReport
;
import
org.springframework.boot.autoconfigure.report.AutoConfigurationReport
;
import
org.springframework.boot.autoconfigure.report.AutoConfigurationReportApplicationContextInitializer
;
import
org.springframework.boot.autoconfigure.report.CreatedBeanInfo
;
import
org.springframework.boot.autoconfigure.report.CreatedBeanInfo
;
import
org.springframework.boot.autoconfigure.report.EnableAutoConfigurationReport
;
import
org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
@@ -39,9 +36,12 @@ import org.springframework.context.annotation.Configuration;
...
@@ -39,9 +36,12 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.context.support.PropertySourcesPlaceholderConfigurer
;
import
org.springframework.context.support.PropertySourcesPlaceholderConfigurer
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.jms.core.JmsTemplate
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
/**
/**
* Tests for {@link AutoConfigurationReport}.
* Tests for {@link AutoConfigurationReport}.
*
*
* @author Greg Turnquist
* @author Greg Turnquist
*/
*/
public
class
AutoConfigurationReportTests
{
public
class
AutoConfigurationReportTests
{
...
@@ -53,6 +53,8 @@ public class AutoConfigurationReportTests {
...
@@ -53,6 +53,8 @@ public class AutoConfigurationReportTests {
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
.
register
(
TestConfiguration
.
class
,
this
.
context
.
register
(
TestConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
);
PropertyPlaceholderAutoConfiguration
.
class
);
new
AutoConfigurationReportApplicationContextInitializer
()
.
initialize
(
this
.
context
);
this
.
context
.
refresh
();
this
.
context
.
refresh
();
AutoConfigurationReport
autoconfigSettings
=
this
.
context
AutoConfigurationReport
autoconfigSettings
=
this
.
context
.
getBean
(
AutoConfigurationReport
.
class
);
.
getBean
(
AutoConfigurationReport
.
class
);
...
@@ -86,7 +88,8 @@ public class AutoConfigurationReportTests {
...
@@ -86,7 +88,8 @@ public class AutoConfigurationReportTests {
@Test
@Test
public
void
rabbitReportTest
()
{
public
void
rabbitReportTest
()
{
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
.
register
(
TestConfiguration
.
class
,
RabbitAutoConfiguration
.
class
);
this
.
context
.
register
(
TestConfiguration
.
class
,
RabbitAutoConfiguration
.
class
,
AutoConfigurationReport
.
class
);
this
.
context
.
refresh
();
this
.
context
.
refresh
();
AutoConfigurationReport
autoconfigSettings
=
this
.
context
AutoConfigurationReport
autoconfigSettings
=
this
.
context
.
getBean
(
AutoConfigurationReport
.
class
);
.
getBean
(
AutoConfigurationReport
.
class
);
...
@@ -117,13 +120,16 @@ public class AutoConfigurationReportTests {
...
@@ -117,13 +120,16 @@ public class AutoConfigurationReportTests {
totalDecisions
+=
1
;
totalDecisions
+=
1
;
if
(
decision
.
contains
(
"RabbitConnectionFactoryCreator matched"
))
{
if
(
decision
.
contains
(
"RabbitConnectionFactoryCreator matched"
))
{
foundRabbitConnectionFactory
=
true
;
foundRabbitConnectionFactory
=
true
;
}
else
if
(
decision
.
contains
(
"OnExpressionCondition"
)
}
else
if
(
decision
.
contains
(
"OnExpressionCondition"
)
&&
decision
.
contains
(
"amqpAdmin matched due to SpEL expression"
))
{
&&
decision
.
contains
(
"amqpAdmin matched due to SpEL expression"
))
{
foundAmqpAdminExpressionCondition
=
true
;
foundAmqpAdminExpressionCondition
=
true
;
}
else
if
(
decision
.
contains
(
"OnBeanCondition"
)
}
else
if
(
decision
.
contains
(
"OnBeanCondition"
)
&&
decision
.
contains
(
"amqpAdmin matched"
))
{
&&
decision
.
contains
(
"amqpAdmin matched"
))
{
foundAmqpAdminBeanCondition
=
true
;
foundAmqpAdminBeanCondition
=
true
;
}
else
if
(
decision
.
contains
(
"rabbitTemplate matched"
))
{
}
else
if
(
decision
.
contains
(
"rabbitTemplate matched"
))
{
foundRabbitTemplateCondition
=
true
;
foundRabbitTemplateCondition
=
true
;
}
}
}
}
...
@@ -139,7 +145,8 @@ public class AutoConfigurationReportTests {
...
@@ -139,7 +145,8 @@ public class AutoConfigurationReportTests {
public
void
verifyItGathersNegativeMatches
()
{
public
void
verifyItGathersNegativeMatches
()
{
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
=
new
AnnotationConfigApplicationContext
();
this
.
context
.
register
(
TestConfiguration2
.
class
,
this
.
context
.
register
(
TestConfiguration2
.
class
,
JmsTemplateAutoConfiguration
.
class
,
MultipartAutoConfiguration
.
class
);
JmsTemplateAutoConfiguration
.
class
,
MultipartAutoConfiguration
.
class
,
AutoConfigurationReport
.
class
);
this
.
context
.
refresh
();
this
.
context
.
refresh
();
AutoConfigurationReport
autoconfigSettings
=
this
.
context
AutoConfigurationReport
autoconfigSettings
=
this
.
context
.
getBean
(
AutoConfigurationReport
.
class
);
.
getBean
(
AutoConfigurationReport
.
class
);
...
@@ -156,7 +163,8 @@ public class AutoConfigurationReportTests {
...
@@ -156,7 +163,8 @@ public class AutoConfigurationReportTests {
.
contains
(
"JmsTemplateAutoConfiguration#jmsTemplate did not match"
)
.
contains
(
"JmsTemplateAutoConfiguration#jmsTemplate did not match"
)
&&
decision
.
contains
(
"found the following [myOwnJmsTemplate]"
))
{
&&
decision
.
contains
(
"found the following [myOwnJmsTemplate]"
))
{
foundMyOwnJmsTemplateAndBackedOff
=
true
;
foundMyOwnJmsTemplateAndBackedOff
=
true
;
}
else
if
(
decision
.
contains
(
"MultipartAutoConfiguration did not match"
)
}
else
if
(
decision
.
contains
(
"MultipartAutoConfiguration did not match"
)
&&
decision
&&
decision
.
contains
(
"list['javax.servlet.MultipartConfigElement']"
)
.
contains
(
"list['javax.servlet.MultipartConfigElement']"
)
&&
decision
.
contains
(
"found no beans"
))
{
&&
decision
.
contains
(
"found no beans"
))
{
...
@@ -164,7 +172,8 @@ public class AutoConfigurationReportTests {
...
@@ -164,7 +172,8 @@ public class AutoConfigurationReportTests {
}
}
}
}
}
}
// varying situations might cause multi-conditional beans to evaluate in different orders
// varying situations might cause multi-conditional beans to evaluate in different
// orders
assertTrue
(
totalNegativeDecisions
>=
2
);
assertTrue
(
totalNegativeDecisions
>=
2
);
assertTrue
(
foundMyOwnJmsTemplateAndBackedOff
);
assertTrue
(
foundMyOwnJmsTemplateAndBackedOff
);
assertTrue
(
didNotFindMultipartConfigElement
);
assertTrue
(
didNotFindMultipartConfigElement
);
...
@@ -172,12 +181,10 @@ public class AutoConfigurationReportTests {
...
@@ -172,12 +181,10 @@ public class AutoConfigurationReportTests {
}
}
@Configuration
@Configuration
@EnableAutoConfigurationReport
public
static
class
TestConfiguration
{
public
static
class
TestConfiguration
{
}
}
@Configuration
@Configuration
@EnableAutoConfigurationReport
public
static
class
TestConfiguration2
{
public
static
class
TestConfiguration2
{
@Bean
@Bean
JmsTemplate
myOwnJmsTemplate
(
javax
.
jms
.
ConnectionFactory
connectionFactory
)
{
JmsTemplate
myOwnJmsTemplate
(
javax
.
jms
.
ConnectionFactory
connectionFactory
)
{
...
...
spring-boot-samples/spring-boot-sample-secure/src/main/java/org/springframework/boot/sample/ops/ui/SampleSecureApplication.java
View file @
0c79c891
...
@@ -20,7 +20,6 @@ import java.util.Date;
...
@@ -20,7 +20,6 @@ import java.util.Date;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.report.EnableAutoConfigurationReport
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.ComponentScan
;
...
@@ -34,7 +33,6 @@ import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
...
@@ -34,7 +33,6 @@ import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
@EnableAutoConfiguration
@EnableAutoConfiguration
@EnableAutoConfigurationReport
@ComponentScan
@ComponentScan
@Controller
@Controller
public
class
SampleSecureApplication
extends
WebMvcConfigurerAdapter
{
public
class
SampleSecureApplication
extends
WebMvcConfigurerAdapter
{
...
...
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