Skip to content

Commit 31a4dc6

Browse files
committed
GH-224: Fix SnsBodyBuilder usage in the Doc
Fixes #224 * Fix `SnsMessageBuilder` -> `SnsBodyBuilder` in the `SnsMessageHandler.onInit()` comment for SpEL import registration * Upgrade to Localstack `2.1.0` * Rename `SnsMessageBuilderTests` -> `SnsBodyBuilderTests` for consistency of its purpose
1 parent 4b004ab commit 31a4dc6

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ The Java Config looks like:
333333
public MessageHandler snsMessageHandler() {
334334
SnsMessageHandler handler = new SnsMessageHandler(amazonSns());
335335
adapter.setTopicArn("arn:aws:sns:eu-west:123456789012:test");
336-
String bodyExpression = "SnsBodyBuilder.withDefault(payload).forProtocols(payload.substring(0, 140), 'sms')";
336+
String bodyExpression = "T(SnsBodyBuilder).withDefault(payload).forProtocols(payload.substring(0, 140), 'sms')";
337337
handler.setBodyExpression(spelExpressionParser.parseExpression(bodyExpression));
338338

339339
// message-group ID and deduplication ID are used for FIFO topics

src/main/java/org/springframework/integration/aws/outbound/SnsMessageHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ protected void onInit() {
192192
if (typeLocator instanceof StandardTypeLocator) {
193193
/*
194194
* Register the 'org.springframework.integration.aws.support' package you
195-
* don't need a FQCN for the 'SnsMessageBuilder'.
195+
* don't need a FQCN for the 'SnsBodyBuilder'.
196196
*/
197197
((StandardTypeLocator) typeLocator).registerImport("org.springframework.integration.aws.support");
198198
}

src/test/java/org/springframework/integration/aws/LocalstackContainerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
public interface LocalstackContainerTest {
4949

5050
LocalStackContainer LOCAL_STACK_CONTAINER =
51-
new LocalStackContainer(DockerImageName.parse("localstack/localstack:2.0.0"));
51+
new LocalStackContainer(DockerImageName.parse("localstack/localstack:2.1.0"));
5252

5353
@BeforeAll
5454
static void startContainer() {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2022 the original author or authors.
2+
* Copyright 2016-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,10 +26,10 @@
2626
/**
2727
* @author Artem Bilan
2828
*/
29-
class SnsMessageBuilderTests {
29+
class SnsBodyBuilderTests {
3030

3131
@Test
32-
void testSnsMessageBuilder() {
32+
void testSnsBodyBuilder() {
3333
assertThatIllegalArgumentException()
3434
.isThrownBy(() -> SnsBodyBuilder.withDefault(""))
3535
.withMessageContaining("defaultMessage must not be empty.");

0 commit comments

Comments
 (0)