Polish Spring Integration metrics support
See gh-7722
This commit is contained in:
@@ -98,10 +98,9 @@ public class IntegrationAutoConfiguration {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnClass({EnableIntegrationManagement.class, EnableIntegrationMBeanExport.class})
|
||||
@ConditionalOnMissingBean(value = IntegrationManagementConfigurer.class,
|
||||
name = IntegrationManagementConfigurer.MANAGEMENT_CONFIGURER_NAME,
|
||||
search = SearchStrategy.CURRENT)
|
||||
@ConditionalOnClass({ EnableIntegrationManagement.class,
|
||||
EnableIntegrationMBeanExport.class })
|
||||
@ConditionalOnMissingBean(value = IntegrationManagementConfigurer.class, name = IntegrationManagementConfigurer.MANAGEMENT_CONFIGURER_NAME, search = SearchStrategy.CURRENT)
|
||||
@ConditionalOnProperty(prefix = "spring.jmx", name = "enabled", havingValue = "true", matchIfMissing = true)
|
||||
protected static class IntegrationManagementConfiguration {
|
||||
|
||||
|
||||
@@ -87,14 +87,17 @@ public class IntegrationAutoConfigurationTests {
|
||||
MBeanServer mBeanServer = this.context.getBean(MBeanServer.class);
|
||||
assertDomains(mBeanServer, true, "org.springframework.integration",
|
||||
"org.springframework.integration.monitor");
|
||||
assertThat(this.context.getBean(IntegrationManagementConfigurer.MANAGEMENT_CONFIGURER_NAME)).isNotNull();
|
||||
Object bean = this.context
|
||||
.getBean(IntegrationManagementConfigurer.MANAGEMENT_CONFIGURER_NAME);
|
||||
assertThat(bean).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void disableJmxIntegration() {
|
||||
load("spring.jmx.enabled=false");
|
||||
assertThat(this.context.getBeansOfType(MBeanServer.class)).hasSize(0);
|
||||
assertThat(this.context.getBeansOfType(IntegrationManagementConfigurer.class)).isEmpty();
|
||||
assertThat(this.context.getBeansOfType(IntegrationManagementConfigurer.class))
|
||||
.isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user