|
|
@ -111,13 +111,15 @@ public class EndpointWebMvcManagementContextConfigurationTests {
|
|
|
|
public void envMvcEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
public void envMvcEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
this.context.register(EnvConfiguration.class, TestEndpointConfiguration.class);
|
|
|
|
this.context.register(EnvConfiguration.class, TestEndpointConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
EnvironmentMvcEndpoint mvcEndpoint = this.context.getBean(EnvironmentMvcEndpoint.class);
|
|
|
|
EnvironmentMvcEndpoint mvcEndpoint = this.context
|
|
|
|
|
|
|
|
.getBean(EnvironmentMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestEnvMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestEnvMvcEndpoint.class);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void metricsMvcEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
public void metricsMvcEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
this.context.register(MetricsConfiguration.class, TestEndpointConfiguration.class);
|
|
|
|
this.context.register(MetricsConfiguration.class,
|
|
|
|
|
|
|
|
TestEndpointConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
MetricsMvcEndpoint mvcEndpoint = this.context.getBean(MetricsMvcEndpoint.class);
|
|
|
|
MetricsMvcEndpoint mvcEndpoint = this.context.getBean(MetricsMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestMetricsMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestMetricsMvcEndpoint.class);
|
|
|
@ -125,7 +127,8 @@ public class EndpointWebMvcManagementContextConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void logFileMvcEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
public void logFileMvcEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
this.context.register(LogFileConfiguration.class, TestEndpointConfiguration.class);
|
|
|
|
this.context.register(LogFileConfiguration.class,
|
|
|
|
|
|
|
|
TestEndpointConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
LogFileMvcEndpoint mvcEndpoint = this.context.getBean(LogFileMvcEndpoint.class);
|
|
|
|
LogFileMvcEndpoint mvcEndpoint = this.context.getBean(LogFileMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestLogFileMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestLogFileMvcEndpoint.class);
|
|
|
@ -133,7 +136,8 @@ public class EndpointWebMvcManagementContextConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void shutdownEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
public void shutdownEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
this.context.register(ShutdownConfiguration.class, TestEndpointConfiguration.class);
|
|
|
|
this.context.register(ShutdownConfiguration.class,
|
|
|
|
|
|
|
|
TestEndpointConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
ShutdownMvcEndpoint mvcEndpoint = this.context.getBean(ShutdownMvcEndpoint.class);
|
|
|
|
ShutdownMvcEndpoint mvcEndpoint = this.context.getBean(ShutdownMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestShutdownMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestShutdownMvcEndpoint.class);
|
|
|
@ -141,15 +145,18 @@ public class EndpointWebMvcManagementContextConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void auditEventsMvcEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
public void auditEventsMvcEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
this.context.register(AuditEventsConfiguration.class, TestEndpointConfiguration.class);
|
|
|
|
this.context.register(AuditEventsConfiguration.class,
|
|
|
|
|
|
|
|
TestEndpointConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
AuditEventsMvcEndpoint mvcEndpoint = this.context.getBean(AuditEventsMvcEndpoint.class);
|
|
|
|
AuditEventsMvcEndpoint mvcEndpoint = this.context
|
|
|
|
|
|
|
|
.getBean(AuditEventsMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestAuditEventsMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestAuditEventsMvcEndpoint.class);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void loggersMvcEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
public void loggersMvcEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
this.context.register(LoggersConfiguration.class, TestEndpointConfiguration.class);
|
|
|
|
this.context.register(LoggersConfiguration.class,
|
|
|
|
|
|
|
|
TestEndpointConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
LoggersMvcEndpoint mvcEndpoint = this.context.getBean(LoggersMvcEndpoint.class);
|
|
|
|
LoggersMvcEndpoint mvcEndpoint = this.context.getBean(LoggersMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestLoggersMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestLoggersMvcEndpoint.class);
|
|
|
@ -157,7 +164,8 @@ public class EndpointWebMvcManagementContextConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void heapdumpMvcEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
public void heapdumpMvcEndpointIsConditionalOnMissingBean() throws Exception {
|
|
|
|
this.context.register(HeapdumpConfiguration.class, TestEndpointConfiguration.class);
|
|
|
|
this.context.register(HeapdumpConfiguration.class,
|
|
|
|
|
|
|
|
TestEndpointConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
HeapdumpMvcEndpoint mvcEndpoint = this.context.getBean(HeapdumpMvcEndpoint.class);
|
|
|
|
HeapdumpMvcEndpoint mvcEndpoint = this.context.getBean(HeapdumpMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestHeapdumpMvcEndpoint.class);
|
|
|
|
assertThat(mvcEndpoint).isInstanceOf(TestHeapdumpMvcEndpoint.class);
|
|
|
@ -171,11 +179,10 @@ public class EndpointWebMvcManagementContextConfigurationTests {
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
@ImportAutoConfiguration({ SecurityAutoConfiguration.class,
|
|
|
|
@ImportAutoConfiguration({ SecurityAutoConfiguration.class,
|
|
|
|
WebMvcAutoConfiguration.class, JacksonAutoConfiguration.class,
|
|
|
|
WebMvcAutoConfiguration.class, JacksonAutoConfiguration.class,
|
|
|
|
HttpMessageConvertersAutoConfiguration.class,
|
|
|
|
HttpMessageConvertersAutoConfiguration.class, EndpointAutoConfiguration.class,
|
|
|
|
EndpointAutoConfiguration.class, EndpointWebMvcAutoConfiguration.class,
|
|
|
|
EndpointWebMvcAutoConfiguration.class,
|
|
|
|
ManagementServerPropertiesAutoConfiguration.class,
|
|
|
|
ManagementServerPropertiesAutoConfiguration.class,
|
|
|
|
PropertyPlaceholderAutoConfiguration.class,
|
|
|
|
PropertyPlaceholderAutoConfiguration.class, WebClientAutoConfiguration.class,
|
|
|
|
WebClientAutoConfiguration.class,
|
|
|
|
|
|
|
|
EndpointWebMvcManagementContextConfiguration.class })
|
|
|
|
EndpointWebMvcManagementContextConfiguration.class })
|
|
|
|
static class TestEndpointConfiguration {
|
|
|
|
static class TestEndpointConfiguration {
|
|
|
|
|
|
|
|
|
|
|
@ -194,7 +201,8 @@ public class EndpointWebMvcManagementContextConfigurationTests {
|
|
|
|
static class EnvConfiguration {
|
|
|
|
static class EnvConfiguration {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@Bean
|
|
|
|
public EnvironmentMvcEndpoint testEnvironmentMvcEndpoint(EnvironmentEndpoint endpoint) {
|
|
|
|
public EnvironmentMvcEndpoint testEnvironmentMvcEndpoint(
|
|
|
|
|
|
|
|
EnvironmentEndpoint endpoint) {
|
|
|
|
return new TestEnvMvcEndpoint(endpoint);
|
|
|
|
return new TestEnvMvcEndpoint(endpoint);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -245,7 +253,8 @@ public class EndpointWebMvcManagementContextConfigurationTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@Bean
|
|
|
|
public AuditEventsMvcEndpoint testAuditEventsMvcEndpoint(AuditEventRepository repository) {
|
|
|
|
public AuditEventsMvcEndpoint testAuditEventsMvcEndpoint(
|
|
|
|
|
|
|
|
AuditEventRepository repository) {
|
|
|
|
return new TestAuditEventsMvcEndpoint(repository);
|
|
|
|
return new TestAuditEventsMvcEndpoint(repository);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|