diff --git a/embedded-localstack/pom.xml b/embedded-localstack/pom.xml index a47ffd5c5..83e67b230 100644 --- a/embedded-localstack/pom.xml +++ b/embedded-localstack/pom.xml @@ -13,7 +13,7 @@ embedded-localstack - 1.12.261 + 1.12.643 diff --git a/embedded-localstack/src/main/java/com/playtika/testcontainer/localstack/EmbeddedLocalStackBootstrapConfiguration.java b/embedded-localstack/src/main/java/com/playtika/testcontainer/localstack/EmbeddedLocalStackBootstrapConfiguration.java index d8b72f2e1..99bcc5b1d 100644 --- a/embedded-localstack/src/main/java/com/playtika/testcontainer/localstack/EmbeddedLocalStackBootstrapConfiguration.java +++ b/embedded-localstack/src/main/java/com/playtika/testcontainer/localstack/EmbeddedLocalStackBootstrapConfiguration.java @@ -65,7 +65,8 @@ public LocalStackContainer localStack(ConfigurableEnvironment environment, .withExposedPorts(properties.getEdgePort()) .withEnv("EDGE_PORT", String.valueOf(properties.getEdgePort())) .withEnv("HOSTNAME", properties.getHostname()) - .withEnv("HOSTNAME_EXTERNAL", properties.getHostnameExternal()) + .withEnv("LOCALSTACK_HOST", properties.getHostnameExternal()) + .withEnv("SKIP_SSL_CERT_DOWNLOAD", "1") .withNetworkAliases(LOCALSTACK_NETWORK_ALIAS); network.ifPresent(localStackContainer::withNetwork); diff --git a/embedded-localstack/src/main/java/com/playtika/testcontainer/localstack/LocalStackProperties.java b/embedded-localstack/src/main/java/com/playtika/testcontainer/localstack/LocalStackProperties.java index f75b7199f..892a1f8bc 100644 --- a/embedded-localstack/src/main/java/com/playtika/testcontainer/localstack/LocalStackProperties.java +++ b/embedded-localstack/src/main/java/com/playtika/testcontainer/localstack/LocalStackProperties.java @@ -16,10 +16,9 @@ public class LocalStackProperties extends CommonContainerProperties { public static final String BEAN_NAME_EMBEDDED_LOCALSTACK = "embeddedLocalstack"; public Collection services = Collections.emptyList(); public int edgePort = 4566; - public String hostname = "127.0.0.1"; + public String hostname = "localhost"; public String hostnameExternal = "127.0.0.1"; - // https://hub.docker.com/r/localstack/localstack @Override public String getDefaultDockerImage() { // Please don`t remove this comment. diff --git a/embedded-localstack/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/embedded-localstack/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 6d87e2af0..c2d4620b6 100644 --- a/embedded-localstack/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/embedded-localstack/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -14,7 +14,7 @@ { "name": "embedded.localstack.docker-image", "type": "java.lang.String", - "defaultValue": "localstack/localstack:0.10.8" + "defaultValue": "localstack/localstack:3.0.0" } ], "hints": [ @@ -36,7 +36,7 @@ "values": [ { "value": "localstack/localstack:3.0.0", - "description": "Default Localstack image in version 0.10.8. Ref https://hub.docker.com/r/localstack/localstack for further info." + "description": "Default Localstack image. Ref https://hub.docker.com/r/localstack/localstack for further info." } ] }, diff --git a/embedded-localstack/src/test/java/com/playtika/testcontainer/localstack/EmbeddedLocalStackTest.java b/embedded-localstack/src/test/java/com/playtika/testcontainer/localstack/EmbeddedLocalStackTest.java index 8cc3d9459..5719e3e4c 100644 --- a/embedded-localstack/src/test/java/com/playtika/testcontainer/localstack/EmbeddedLocalStackTest.java +++ b/embedded-localstack/src/test/java/com/playtika/testcontainer/localstack/EmbeddedLocalStackTest.java @@ -15,6 +15,7 @@ import com.amazonaws.services.sqs.AmazonSQS; import com.amazonaws.services.sqs.AmazonSQSClientBuilder; import com.amazonaws.services.sqs.model.CreateQueueResult; +import com.amazonaws.services.sqs.model.SendMessageRequest; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -91,10 +92,12 @@ public void shouldStartSQS() { CreateQueueResult queueResult = sqs.createQueue("baz"); String fooQueueUrl = queueResult.getQueueUrl(); - assertThat(fooQueueUrl). - contains("http://" + properties.getHostname() + ":" + sqsPort); - sqs.sendMessage(fooQueueUrl, "test"); + SendMessageRequest sendMessageRequest = new SendMessageRequest(); + sendMessageRequest.setQueueUrl(fooQueueUrl); + sendMessageRequest.setMessageBody("test"); + sqs.sendMessage(sendMessageRequest); + long messageCount = sqs.receiveMessage(fooQueueUrl).getMessages().stream() .filter(message -> message.getBody().equals("test")) .count();