diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java index 3dd63794eee..d90a1cb29cc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java @@ -414,9 +414,7 @@ class IntegrationAutoConfigurationTests { GenericMessage testMessage = new GenericMessage<>("test"); context.getBean("testChannel", QueueChannel.class).send(testMessage); - @SuppressWarnings("unchecked") - BlockingQueue> sink = context.getBean("sink", BlockingQueue.class); - assertThat(sink.poll(10, TimeUnit.SECONDS)).isSameAs(testMessage); + assertThat(context.getBean("sink", BlockingQueue.class).poll(10, TimeUnit.SECONDS)).isSameAs(testMessage); }); } @@ -457,7 +455,22 @@ class IntegrationAutoConfigurationTests { } @Test - void whenFixedRatePollerPropertyIsSetThenItIsReflectedAsFixedRatePropetyOfPeriodicTrigger() { + void whenFixedDelayPollerPropertyIsSetThenItIsReflectedAsFixedDelayPropertyOfPeriodicTrigger() { + this.contextRunner.withUserConfiguration(PollingConsumerConfiguration.class) + .withPropertyValues("spring.integration.poller.fixed-delay=5000").run((context) -> { + assertThat(context).hasSingleBean(PollerMetadata.class); + PollerMetadata metadata = context.getBean(PollerMetadata.DEFAULT_POLLER, PollerMetadata.class); + assertThat(metadata.getTrigger()) + .asInstanceOf(InstanceOfAssertFactories.type(PeriodicTrigger.class)) + .satisfies((trigger) -> { + assertThat(trigger.getPeriod()).isEqualTo(5000L); + assertThat(trigger.isFixedRate()).isFalse(); + }); + }); + } + + @Test + void whenFixedRatePollerPropertyIsSetThenItIsReflectedAsFixedRatePropertyOfPeriodicTrigger() { this.contextRunner.withUserConfiguration(PollingConsumerConfiguration.class) .withPropertyValues("spring.integration.poller.fixed-rate=5000").run((context) -> { assertThat(context).hasSingleBean(PollerMetadata.class);