From c6c58277e81c72447320359dc16c998405c61c20 Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Fri, 19 Jul 2024 01:43:59 +0200 Subject: [PATCH] GH-737 - Work around double registry registration in AWS integration tests. Looks like Boot 3.4 registers an addition DynamicPropertyRegistry bean. --- .../events/aws/sns/SnsEventPublicationIntegrationTests.java | 3 ++- .../events/aws/sqs/SqsEventPublicationIntegrationTests.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-modulith-events/spring-modulith-events-aws-sns/src/test/java/org/springframework/modulith/events/aws/sns/SnsEventPublicationIntegrationTests.java b/spring-modulith-events/spring-modulith-events-aws-sns/src/test/java/org/springframework/modulith/events/aws/sns/SnsEventPublicationIntegrationTests.java index ea5e99d5..28ee75af 100644 --- a/spring-modulith-events/spring-modulith-events-aws-sns/src/test/java/org/springframework/modulith/events/aws/sns/SnsEventPublicationIntegrationTests.java +++ b/spring-modulith-events/spring-modulith-events-aws-sns/src/test/java/org/springframework/modulith/events/aws/sns/SnsEventPublicationIntegrationTests.java @@ -28,6 +28,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.ApplicationEventPublisher; @@ -56,7 +57,7 @@ class SnsEventPublicationIntegrationTests { static class TestConfiguration { @Bean - LocalStackContainer localStackContainer(DynamicPropertyRegistry registry) { + LocalStackContainer localStackContainer(@Qualifier("dynamicPropertyRegistry") DynamicPropertyRegistry registry) { var localstack = new LocalStackContainer(DockerImageName.parse("localstack/localstack:latest")); diff --git a/spring-modulith-events/spring-modulith-events-aws-sqs/src/test/java/org/springframework/modulith/events/aws/sqs/SqsEventPublicationIntegrationTests.java b/spring-modulith-events/spring-modulith-events-aws-sqs/src/test/java/org/springframework/modulith/events/aws/sqs/SqsEventPublicationIntegrationTests.java index 8e6a7afb..ba76a591 100644 --- a/spring-modulith-events/spring-modulith-events-aws-sqs/src/test/java/org/springframework/modulith/events/aws/sqs/SqsEventPublicationIntegrationTests.java +++ b/spring-modulith-events/spring-modulith-events-aws-sqs/src/test/java/org/springframework/modulith/events/aws/sqs/SqsEventPublicationIntegrationTests.java @@ -27,6 +27,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.ApplicationEventPublisher; @@ -55,7 +56,7 @@ class SqsEventPublicationIntegrationTests { static class TestConfiguration { @Bean - LocalStackContainer localStackContainer(DynamicPropertyRegistry registry) { + LocalStackContainer localStackContainer(@Qualifier("dynamicPropertyRegistry") DynamicPropertyRegistry registry) { var localstack = new LocalStackContainer(DockerImageName.parse("localstack/localstack:latest"));