From fb9dd2c167d92ff140dd599c751c03e5a9965a1f Mon Sep 17 00:00:00 2001 From: K Siva Prasad Reddy Date: Thu, 3 Aug 2023 11:18:43 +0530 Subject: [PATCH] Add local development support --- build.gradle | 6 ++++-- pom.xml | 12 +++++++++++- .../com/testcontainers/demo/TestApplication.java | 9 +-------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 198cc96..c678bd3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' - id 'org.springframework.boot' version '3.1.1' - id 'io.spring.dependency-management' version '1.1.0' + id 'org.springframework.boot' version '3.1.2' + id 'io.spring.dependency-management' version '1.1.2' id 'com.diffplug.spotless' version "6.18.0" } @@ -29,7 +29,9 @@ dependencies { implementation 'io.awspring.cloud:spring-cloud-aws-starter-s3' implementation 'io.awspring.cloud:spring-cloud-aws-starter-sqs' + testImplementation 'org.springframework.boot:spring-boot-devtools' testImplementation 'org.springframework.boot:spring-boot-starter-test' + testImplementation 'org.springframework.boot:spring-boot-testcontainers' testImplementation 'org.testcontainers:junit-jupiter' testImplementation 'org.testcontainers:localstack' testImplementation 'org.awaitility:awaitility' diff --git a/pom.xml b/pom.xml index c6aa662..d619b24 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.springframework.boot spring-boot-starter-parent - 3.1.1 + 3.1.2 com.testcontainers @@ -34,11 +34,21 @@ io.awspring.cloud spring-cloud-aws-starter-sqs + + org.springframework.boot + spring-boot-devtools + true + org.springframework.boot spring-boot-starter-test test + + org.springframework.boot + spring-boot-testcontainers + test + org.testcontainers junit-jupiter diff --git a/src/test/java/com/testcontainers/demo/TestApplication.java b/src/test/java/com/testcontainers/demo/TestApplication.java index efc5126..6c67ae4 100644 --- a/src/test/java/com/testcontainers/demo/TestApplication.java +++ b/src/test/java/com/testcontainers/demo/TestApplication.java @@ -1,8 +1,5 @@ package com.testcontainers.demo; -import static org.testcontainers.containers.localstack.LocalStackContainer.Service.S3; -import static org.testcontainers.containers.localstack.LocalStackContainer.Service.SQS; - import java.util.UUID; import org.springframework.boot.SpringApplication; import org.testcontainers.containers.localstack.LocalStackContainer; @@ -32,11 +29,7 @@ static void setup() { System.setProperty("spring.cloud.aws.credentials.access-key", container.getAccessKey()); System.setProperty("spring.cloud.aws.credentials.secret-key", container.getSecretKey()); System.setProperty( - "spring.cloud.aws.s3.endpoint", - container.getEndpointOverride(S3).toString()); - System.setProperty( - "spring.cloud.aws.sqs.endpoint", - container.getEndpointOverride(SQS).toString()); + "spring.cloud.aws.endpoint", container.getEndpoint().toString()); } catch (Exception e) { throw new RuntimeException(e); }