Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion embedded-localstack/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* `embedded.localstack.enabled` `(true|false, default is true)`
* `embedded.localstack.reuseContainer` `(true|false, default is false)`
* `embedded.localstack.services` `(comma separated list of AWS services (S3, SQS, DYNAMODB, etc. Should be non empty)`
* `embedded.localstack.dockerImage` `(default is 'localstack/localstack:2.3.2')`
* `embedded.localstack.dockerImage` `(default is 'localstack/localstack:3.0.0')`
** Image versions on https://hub.docker.com/r/localstack/localstack/tags[dockerhub]
* `embedded.localstack.useSsl` `(default is false)`
* `embedded.localstack.hostname` `(default is 'localhost')`
Expand Down
2 changes: 1 addition & 1 deletion embedded-localstack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<artifactId>embedded-localstack</artifactId>

<properties>
<aws-java-sdk.version>1.12.261</aws-java-sdk.version>
<aws-java-sdk.version>1.12.643</aws-java-sdk.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ public class LocalStackProperties extends CommonContainerProperties {
public static final String BEAN_NAME_EMBEDDED_LOCALSTACK = "embeddedLocalstack";
public Collection<LocalStackContainer.Service> 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.
// renovate: datasource=docker
return "localstack/localstack:2.3.2";
return "localstack/localstack:3.0.0";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -35,8 +35,8 @@
"name": "embedded.localstack.docker-image",
"values": [
{
"value": "localstack/localstack:2.3.2",
"description": "Default Localstack image in version 0.10.8. Ref https://hub.docker.com/r/localstack/localstack for further info."
"value": "localstack/localstack:3.0.0",
"description": "Default Localstack image. Ref https://hub.docker.com/r/localstack/localstack for further info."
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down