Fix package tangle with AutoConfigurationReport
Rename AutoConfigurationReport to ConditionEvaluationReport and co-locate with conditions.
This commit is contained in:
parent
32f3e353b4
commit
f7d4490b2d
|
|
@ -44,8 +44,8 @@ import org.springframework.boot.actuate.metrics.reader.MetricReader;
|
|||
import org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository;
|
||||
import org.springframework.boot.actuate.trace.InMemoryTraceRepository;
|
||||
import org.springframework.boot.actuate.trace.TraceRepository;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationReport;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.SearchStrategy;
|
||||
|
|
@ -148,7 +148,7 @@ public class EndpointAutoConfiguration {
|
|||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(AutoConfigurationReport.class)
|
||||
@ConditionalOnBean(ConditionEvaluationReport.class)
|
||||
@ConditionalOnMissingBean(search = SearchStrategy.CURRENT)
|
||||
public AutoConfigurationReportEndpoint autoConfigurationAuditEndpoint() {
|
||||
return new AutoConfigurationReportEndpoint();
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ import java.util.Map;
|
|||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.actuate.endpoint.AutoConfigurationReportEndpoint.Report;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationReport;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationReport.ConditionAndOutcome;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationReport.ConditionAndOutcomes;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport.ConditionAndOutcome;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport.ConditionAndOutcomes;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Condition;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
|
@ -37,7 +37,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
|||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
/**
|
||||
* {@link Endpoint} to expose the {@link AutoConfigurationReport}.
|
||||
* {@link Endpoint} to expose the {@link ConditionEvaluationReport}.
|
||||
*
|
||||
* @author Greg Turnquist
|
||||
* @author Phillip Webb
|
||||
|
|
@ -47,7 +47,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
|||
public class AutoConfigurationReportEndpoint extends AbstractEndpoint<Report> {
|
||||
|
||||
@Autowired
|
||||
private AutoConfigurationReport autoConfigurationReport;
|
||||
private ConditionEvaluationReport autoConfigurationReport;
|
||||
|
||||
public AutoConfigurationReportEndpoint() {
|
||||
super("autoconfig");
|
||||
|
|
@ -59,7 +59,7 @@ public class AutoConfigurationReportEndpoint extends AbstractEndpoint<Report> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Adapts {@link AutoConfigurationReport} to a JSON friendly structure.
|
||||
* Adapts {@link ConditionEvaluationReport} to a JSON friendly structure.
|
||||
*/
|
||||
@JsonPropertyOrder({ "positiveMatches", "negativeMatches" })
|
||||
@JsonInclude(Include.NON_EMPTY)
|
||||
|
|
@ -71,7 +71,7 @@ public class AutoConfigurationReportEndpoint extends AbstractEndpoint<Report> {
|
|||
|
||||
private Report parent;
|
||||
|
||||
public Report(AutoConfigurationReport report) {
|
||||
public Report(ConditionEvaluationReport report) {
|
||||
this.positiveMatches = new LinkedMultiValueMap<String, MessageAndCondition>();
|
||||
this.negativeMatches = new LinkedMultiValueMap<String, MessageAndCondition>();
|
||||
for (Map.Entry<String, ConditionAndOutcomes> entry : report
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import org.springframework.boot.actuate.endpoint.InfoEndpoint;
|
|||
import org.springframework.boot.actuate.endpoint.MetricsEndpoint;
|
||||
import org.springframework.boot.actuate.endpoint.ShutdownEndpoint;
|
||||
import org.springframework.boot.actuate.endpoint.TraceEndpoint;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationReport;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport;
|
||||
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
|
||||
import org.springframework.boot.test.EnvironmentTestUtils;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
|
|
@ -96,7 +96,7 @@ public class EndpointAutoConfigurationTests {
|
|||
public void autoconfigurationAuditEndpoints() {
|
||||
this.context = new AnnotationConfigApplicationContext();
|
||||
this.context.register(EndpointAutoConfiguration.class,
|
||||
AutoConfigurationReport.class);
|
||||
ConditionEvaluationReport.class);
|
||||
this.context.refresh();
|
||||
assertNotNull(this.context.getBean(AutoConfigurationReportEndpoint.class));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import javax.annotation.PostConstruct;
|
|||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.actuate.endpoint.AutoConfigurationReportEndpoint.Report;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationReport;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
|
|
@ -62,7 +62,7 @@ public class AutoConfigurationReportEndpointTests extends
|
|||
|
||||
@PostConstruct
|
||||
public void setupAutoConfigurationReport() {
|
||||
AutoConfigurationReport report = AutoConfigurationReport.get(this.context
|
||||
ConditionEvaluationReport report = ConditionEvaluationReport.get(this.context
|
||||
.getBeanFactory());
|
||||
report.recordConditionEvaluation("a", mock(Condition.class),
|
||||
mock(ConditionOutcome.class));
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure;
|
||||
package org.springframework.boot.autoconfigure.condition;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
|
|
@ -26,31 +26,30 @@ import java.util.TreeMap;
|
|||
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
|
||||
import org.springframework.context.annotation.Condition;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* Records auto-configuration details for reporting and logging.
|
||||
* Records condition evaluation details for reporting and logging.
|
||||
*
|
||||
* @author Greg Turnquist
|
||||
* @author Dave Syer
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
public class AutoConfigurationReport {
|
||||
public class ConditionEvaluationReport {
|
||||
|
||||
private static final String BEAN_NAME = "autoConfigurationReport";
|
||||
|
||||
private final SortedMap<String, ConditionAndOutcomes> outcomes = new TreeMap<String, ConditionAndOutcomes>();
|
||||
|
||||
private AutoConfigurationReport parent;
|
||||
private ConditionEvaluationReport parent;
|
||||
|
||||
/**
|
||||
* Private constructor.
|
||||
* @see #get(ConfigurableListableBeanFactory)
|
||||
*/
|
||||
private AutoConfigurationReport() {
|
||||
private ConditionEvaluationReport() {
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -81,23 +80,24 @@ public class AutoConfigurationReport {
|
|||
* The parent report (from a parent BeanFactory if there is one).
|
||||
* @return the parent report (or null if there isn't one)
|
||||
*/
|
||||
public AutoConfigurationReport getParent() {
|
||||
public ConditionEvaluationReport getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain a {@link AutoConfigurationReport} for the specified bean factory.
|
||||
* Obtain a {@link ConditionEvaluationReport} for the specified bean factory.
|
||||
* @param beanFactory the bean factory
|
||||
* @return an existing or new {@link AutoConfigurationReport}
|
||||
* @return an existing or new {@link ConditionEvaluationReport}
|
||||
*/
|
||||
public static AutoConfigurationReport get(ConfigurableListableBeanFactory beanFactory) {
|
||||
public static ConditionEvaluationReport get(
|
||||
ConfigurableListableBeanFactory beanFactory) {
|
||||
synchronized (beanFactory) {
|
||||
AutoConfigurationReport report;
|
||||
ConditionEvaluationReport report;
|
||||
if (beanFactory.containsSingleton(BEAN_NAME)) {
|
||||
report = beanFactory.getBean(BEAN_NAME, AutoConfigurationReport.class);
|
||||
report = beanFactory.getBean(BEAN_NAME, ConditionEvaluationReport.class);
|
||||
}
|
||||
else {
|
||||
report = new AutoConfigurationReport();
|
||||
report = new ConditionEvaluationReport();
|
||||
beanFactory.registerSingleton(BEAN_NAME, report);
|
||||
}
|
||||
locateParent(beanFactory.getParentBeanFactory(), report);
|
||||
|
|
@ -106,10 +106,11 @@ public class AutoConfigurationReport {
|
|||
}
|
||||
|
||||
private static void locateParent(BeanFactory beanFactory,
|
||||
AutoConfigurationReport report) {
|
||||
ConditionEvaluationReport report) {
|
||||
if (beanFactory != null && report.parent == null
|
||||
&& beanFactory.containsBean(BEAN_NAME)) {
|
||||
report.parent = beanFactory.getBean(BEAN_NAME, AutoConfigurationReport.class);
|
||||
report.parent = beanFactory.getBean(BEAN_NAME,
|
||||
ConditionEvaluationReport.class);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure.condition;
|
|||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationReport;
|
||||
import org.springframework.context.annotation.Condition;
|
||||
import org.springframework.context.annotation.ConditionContext;
|
||||
import org.springframework.core.type.AnnotatedTypeMetadata;
|
||||
|
|
@ -43,7 +42,7 @@ public abstract class SpringBootCondition implements Condition {
|
|||
String classOrMethodName = getClassOrMethodName(metadata);
|
||||
ConditionOutcome outcome = getMatchOutcome(context, metadata);
|
||||
logOutcome(classOrMethodName, outcome);
|
||||
recordInAutoConfigurationReport(context, classOrMethodName, outcome);
|
||||
recordEvaluation(context, classOrMethodName, outcome);
|
||||
return outcome.isMatch();
|
||||
}
|
||||
|
||||
|
|
@ -77,10 +76,10 @@ public abstract class SpringBootCondition implements Condition {
|
|||
return message;
|
||||
}
|
||||
|
||||
private void recordInAutoConfigurationReport(ConditionContext context,
|
||||
private void recordEvaluation(ConditionContext context,
|
||||
String classOrMethodName, ConditionOutcome outcome) {
|
||||
if (context.getBeanFactory() != null) {
|
||||
AutoConfigurationReport.get(context.getBeanFactory())
|
||||
ConditionEvaluationReport.get(context.getBeanFactory())
|
||||
.recordConditionEvaluation(classOrMethodName, this, outcome);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,14 +14,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure;
|
||||
package org.springframework.boot.autoconfigure.logging;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationReport.ConditionAndOutcome;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationReport.ConditionAndOutcomes;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport.ConditionAndOutcome;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport.ConditionAndOutcomes;
|
||||
import org.springframework.boot.event.ApplicationFailedEvent;
|
||||
import org.springframework.boot.logging.LogLevel;
|
||||
import org.springframework.context.ApplicationContextInitializer;
|
||||
|
|
@ -36,7 +37,7 @@ import org.springframework.util.ClassUtils;
|
|||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* {@link ApplicationContextInitializer} that writes the {@link AutoConfigurationReport}
|
||||
* {@link ApplicationContextInitializer} that writes the {@link ConditionEvaluationReport}
|
||||
* to the log. Reports are logged at the {@link LogLevel#DEBUG DEBUG} level unless there
|
||||
* was a problem, in which case they are the {@link LogLevel#INFO INFO} level is used.
|
||||
* <p>
|
||||
|
|
@ -54,7 +55,7 @@ public class AutoConfigurationReportLoggingInitializer implements
|
|||
|
||||
private ConfigurableApplicationContext applicationContext;
|
||||
|
||||
private AutoConfigurationReport report;
|
||||
private ConditionEvaluationReport report;
|
||||
|
||||
@Override
|
||||
public void initialize(ConfigurableApplicationContext applicationContext) {
|
||||
|
|
@ -62,7 +63,7 @@ public class AutoConfigurationReportLoggingInitializer implements
|
|||
applicationContext.addApplicationListener(new AutoConfigurationReportListener());
|
||||
if (applicationContext instanceof GenericApplicationContext) {
|
||||
// Get the report early in case the context fails to load
|
||||
this.report = AutoConfigurationReport.get(this.applicationContext
|
||||
this.report = ConditionEvaluationReport.get(this.applicationContext
|
||||
.getBeanFactory());
|
||||
}
|
||||
}
|
||||
|
|
@ -91,7 +92,7 @@ public class AutoConfigurationReportLoggingInitializer implements
|
|||
+ "due to missing ApplicationContext");
|
||||
return;
|
||||
}
|
||||
this.report = AutoConfigurationReport.get(this.applicationContext
|
||||
this.report = ConditionEvaluationReport.get(this.applicationContext
|
||||
.getBeanFactory());
|
||||
}
|
||||
if (this.report.getConditionAndOutcomesBySource().size() > 0) {
|
||||
|
|
@ -1,3 +1,7 @@
|
|||
# Initializers
|
||||
org.springframework.context.ApplicationContextInitializer=\
|
||||
org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer
|
||||
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.springframework.boot.autoconfigure.aop.AopAutoConfiguration,\
|
||||
|
|
@ -24,6 +28,3 @@ org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration,\
|
|||
org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.websocket.WebSocketAutoConfiguration
|
||||
|
||||
org.springframework.context.ApplicationContextInitializer=\
|
||||
org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure;
|
||||
package org.springframework.boot.autoconfigure.condition;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
|
@ -29,9 +29,10 @@ import org.mockito.MockitoAnnotations;
|
|||
import org.springframework.beans.factory.annotation.Configurable;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationReport.ConditionAndOutcome;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationReport.ConditionAndOutcomes;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport.ConditionAndOutcome;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport.ConditionAndOutcomes;
|
||||
import org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
|
|
@ -47,7 +48,7 @@ import static org.hamcrest.Matchers.sameInstance;
|
|||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* Tests for {@link AutoConfigurationReport}.
|
||||
* Tests for {@link ConditionEvaluationReport}.
|
||||
*
|
||||
* @author Greg Turnquist
|
||||
* @author Phillip Webb
|
||||
|
|
@ -56,7 +57,7 @@ public class AutoConfigurationReportTests {
|
|||
|
||||
private DefaultListableBeanFactory beanFactory;
|
||||
|
||||
private AutoConfigurationReport report;
|
||||
private ConditionEvaluationReport report;
|
||||
|
||||
@Mock
|
||||
private Condition condition1;
|
||||
|
|
@ -77,31 +78,31 @@ public class AutoConfigurationReportTests {
|
|||
public void setup() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
this.beanFactory = new DefaultListableBeanFactory();
|
||||
this.report = AutoConfigurationReport.get(this.beanFactory);
|
||||
this.report = ConditionEvaluationReport.get(this.beanFactory);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void get() throws Exception {
|
||||
assertThat(this.report, not(nullValue()));
|
||||
assertThat(this.report,
|
||||
sameInstance(AutoConfigurationReport.get(this.beanFactory)));
|
||||
sameInstance(ConditionEvaluationReport.get(this.beanFactory)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parent() throws Exception {
|
||||
this.beanFactory.setParentBeanFactory(new DefaultListableBeanFactory());
|
||||
AutoConfigurationReport.get((ConfigurableListableBeanFactory) this.beanFactory
|
||||
ConditionEvaluationReport.get((ConfigurableListableBeanFactory) this.beanFactory
|
||||
.getParentBeanFactory());
|
||||
assertThat(this.report,
|
||||
sameInstance(AutoConfigurationReport.get(this.beanFactory)));
|
||||
sameInstance(ConditionEvaluationReport.get(this.beanFactory)));
|
||||
assertThat(this.report, not(nullValue()));
|
||||
assertThat(this.report.getParent(), not(nullValue()));
|
||||
AutoConfigurationReport.get((ConfigurableListableBeanFactory) this.beanFactory
|
||||
ConditionEvaluationReport.get((ConfigurableListableBeanFactory) this.beanFactory
|
||||
.getParentBeanFactory());
|
||||
assertThat(this.report,
|
||||
sameInstance(AutoConfigurationReport.get(this.beanFactory)));
|
||||
sameInstance(ConditionEvaluationReport.get(this.beanFactory)));
|
||||
assertThat(this.report.getParent(),
|
||||
sameInstance(AutoConfigurationReport
|
||||
sameInstance(ConditionEvaluationReport
|
||||
.get((ConfigurableListableBeanFactory) this.beanFactory
|
||||
.getParentBeanFactory())));
|
||||
}
|
||||
|
|
@ -110,9 +111,9 @@ public class AutoConfigurationReportTests {
|
|||
public void parentBottomUp() throws Exception {
|
||||
this.beanFactory = new DefaultListableBeanFactory(); // NB: overrides setup
|
||||
this.beanFactory.setParentBeanFactory(new DefaultListableBeanFactory());
|
||||
AutoConfigurationReport.get((ConfigurableListableBeanFactory) this.beanFactory
|
||||
ConditionEvaluationReport.get((ConfigurableListableBeanFactory) this.beanFactory
|
||||
.getParentBeanFactory());
|
||||
this.report = AutoConfigurationReport.get(this.beanFactory);
|
||||
this.report = ConditionEvaluationReport.get(this.beanFactory);
|
||||
assertThat(this.report, not(nullValue()));
|
||||
assertThat(this.report, not(sameInstance(this.report.getParent())));
|
||||
assertThat(this.report.getParent(), not(nullValue()));
|
||||
|
|
@ -174,7 +175,7 @@ public class AutoConfigurationReportTests {
|
|||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void springBootConditionPopulatesReport() throws Exception {
|
||||
AutoConfigurationReport report = AutoConfigurationReport
|
||||
ConditionEvaluationReport report = ConditionEvaluationReport
|
||||
.get(new AnnotationConfigApplicationContext(Config.class)
|
||||
.getBeanFactory());
|
||||
assertThat(report.getConditionAndOutcomesBySource().size(), not(equalTo(0)));
|
||||
|
|
@ -206,7 +207,7 @@ public class AutoConfigurationReportTests {
|
|||
public void duplicateOutcomes() {
|
||||
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
|
||||
DuplicateConfig.class);
|
||||
AutoConfigurationReport report = AutoConfigurationReport.get(context
|
||||
ConditionEvaluationReport report = ConditionEvaluationReport.get(context
|
||||
.getBeanFactory());
|
||||
String autoconfigKey = MultipartAutoConfiguration.class.getName();
|
||||
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure;
|
||||
package org.springframework.boot.autoconfigure.logging;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -30,6 +30,9 @@ import org.junit.Test;
|
|||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport;
|
||||
import org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer;
|
||||
import org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
|
||||
import org.springframework.boot.event.ApplicationFailedEvent;
|
||||
|
|
@ -175,7 +178,7 @@ public class AutoConfigurationReportLoggingInitializerTests {
|
|||
context.register(Config.class);
|
||||
new AutoConfigurationReportLoggingInitializer().initialize(context);
|
||||
context.refresh();
|
||||
assertNotNull(context.getBean(AutoConfigurationReport.class));
|
||||
assertNotNull(context.getBean(ConditionEvaluationReport.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -185,7 +188,7 @@ public class AutoConfigurationReportLoggingInitializerTests {
|
|||
context.register(Config.class);
|
||||
new AutoConfigurationReportLoggingInitializer().initialize(context);
|
||||
context.refresh();
|
||||
assertNotNull(context.getBean(AutoConfigurationReport.class));
|
||||
assertNotNull(context.getBean(ConditionEvaluationReport.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -18,10 +18,10 @@ package org.springframework.boot.autoconfigure.security;
|
|||
|
||||
import org.junit.Test;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer;
|
||||
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer;
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.test.City;
|
||||
import org.springframework.boot.context.listener.LoggingApplicationListener;
|
||||
|
|
|
|||
Loading…
Reference in New Issue