Fix @EnableIntegrationManagement
Restore proper use of `defaultCountsEnabled` that was inadvertently changed to `countsEnabled` Closes gh-12594
This commit is contained in:
parent
0b1c293e22
commit
42e81e987b
|
@ -120,7 +120,7 @@ public class IntegrationAutoConfiguration {
|
|||
protected static class IntegrationManagementConfiguration {
|
||||
|
||||
@Configuration
|
||||
@EnableIntegrationManagement(countsEnabled = "true")
|
||||
@EnableIntegrationManagement(defaultCountsEnabled = "true")
|
||||
protected static class EnableIntegrationManagementConfiguration {
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.junit.Rule;
|
|||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration.IntegrationComponentScanAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
|
||||
|
@ -35,7 +36,10 @@ import org.springframework.context.annotation.Configuration;
|
|||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.integration.annotation.IntegrationComponentScan;
|
||||
import org.springframework.integration.annotation.MessagingGateway;
|
||||
import org.springframework.integration.core.MessageSource;
|
||||
import org.springframework.integration.endpoint.MessageProcessorMessageSource;
|
||||
import org.springframework.integration.gateway.RequestReplyExchanger;
|
||||
import org.springframework.integration.handler.MessageProcessor;
|
||||
import org.springframework.integration.support.channel.HeaderChannelRegistry;
|
||||
import org.springframework.integration.support.management.IntegrationManagementConfigurer;
|
||||
import org.springframework.jdbc.BadSqlGrammarException;
|
||||
|
@ -196,6 +200,16 @@ public class IntegrationAutoConfigurationTests {
|
|||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void integrationEnablesDefaultCounts() {
|
||||
this.contextRunner.withUserConfiguration(MessageSourceConfiguration.class)
|
||||
.run((context) -> {
|
||||
assertThat(context).hasBean("myMessageSource");
|
||||
assertThat(new DirectFieldAccessor(context.getBean("myMessageSource"))
|
||||
.getPropertyValue("countsEnabled")).isEqualTo(true);
|
||||
});
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class CustomMBeanExporter {
|
||||
|
||||
|
@ -218,4 +232,14 @@ public class IntegrationAutoConfigurationTests {
|
|||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class MessageSourceConfiguration {
|
||||
|
||||
@Bean
|
||||
public MessageSource<?> myMessageSource() {
|
||||
return new MessageProcessorMessageSource(mock(MessageProcessor.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue