From 70a45cf86d92df80100341f4cd8bc4a35bcedc28 Mon Sep 17 00:00:00 2001 From: Marcos Tischer Vallim Date: Wed, 21 Feb 2024 17:57:43 -0300 Subject: [PATCH 1/3] chore: organize code --- .github/workflows/maven.yml | 6 +++--- README.md | 2 +- .../core/AmazonSnsThreadPoolExecutorTest.java | 4 +--- .../messaging/{ => lib}/model/RequestEntryTest.java | 4 +--- .../sns/messaging/lib/core/MessageAttributes.java | 2 +- .../sns/messaging/lib/core/MessageAttributes.java | 2 +- pom.xml | 10 ++++++++-- 7 files changed, 16 insertions(+), 14 deletions(-) rename amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/{ => lib}/core/AmazonSnsThreadPoolExecutorTest.java (97%) rename amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/{ => lib}/model/RequestEntryTest.java (94%) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 8c9612a..4fe17ab 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java-version: [8, 11, 15, 16, 17] + java-version: [8, 11, 17, 21] steps: - uses: actions/checkout@v3 - name: Set up JDK @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java-version: [8, 11, 15, 16, 17] + java-version: [8, 11, 17, 21] needs: [build] steps: - uses: actions/checkout@v3 @@ -91,7 +91,7 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - name: Build and analyze - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=amazon-sns-java-messaging-lib -Dsonar.organization=mvallim -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=amazon-sns-java-messaging-lib -Dsonar.organization=mvallim -Dsonar.host.url=https://sonarcloud.io -Dssonar.token=$SONAR_TOKEN env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/README.md b/README.md index f49c58c..8307508 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Combine multiple requests to optimally utilise the network. Article [Martin Fowler](https://martinfowler.com) [Request Batch](https://martinfowler.com/articles/patterns-of-distributed-systems/request-batch.html) -_**Compatible JDK 8, 11, 15, 16 and 17**_ +_**Compatible JDK 8, 11, 17 and 21**_ _**Compatible AWS JDK v1 >= 1.12**_ diff --git a/amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/core/AmazonSnsThreadPoolExecutorTest.java b/amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/lib/core/AmazonSnsThreadPoolExecutorTest.java similarity index 97% rename from amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/core/AmazonSnsThreadPoolExecutorTest.java rename to amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/lib/core/AmazonSnsThreadPoolExecutorTest.java index a68b45b..057450d 100644 --- a/amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/core/AmazonSnsThreadPoolExecutorTest.java +++ b/amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/lib/core/AmazonSnsThreadPoolExecutorTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.amazon.sns.messaging.core; +package com.amazon.sns.messaging.lib.core; import static org.assertj.core.api.Assertions.catchThrowableOfType; import static org.hamcrest.MatcherAssert.assertThat; @@ -25,8 +25,6 @@ import org.junit.jupiter.api.Test; -import com.amazon.sns.messaging.lib.core.AmazonSnsThreadPoolExecutor; - // @formatter:off class AmazonSnsThreadPoolExecutorTest { diff --git a/amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/model/RequestEntryTest.java b/amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/lib/model/RequestEntryTest.java similarity index 94% rename from amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/model/RequestEntryTest.java rename to amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/lib/model/RequestEntryTest.java index a26e99b..32db175 100644 --- a/amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/model/RequestEntryTest.java +++ b/amazon-sns-java-messaging-lib-template/src/test/java/com/amazon/sns/messaging/lib/model/RequestEntryTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.amazon.sns.messaging.model; +package com.amazon.sns.messaging.lib.model; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; @@ -24,8 +24,6 @@ import org.junit.jupiter.api.Test; -import com.amazon.sns.messaging.lib.model.RequestEntry; - // @formatter:off class RequestEntryTest { diff --git a/amazon-sns-java-messaging-lib-v1/src/main/java/com/amazon/sns/messaging/lib/core/MessageAttributes.java b/amazon-sns-java-messaging-lib-v1/src/main/java/com/amazon/sns/messaging/lib/core/MessageAttributes.java index 05d6241..69079ef 100644 --- a/amazon-sns-java-messaging-lib-v1/src/main/java/com/amazon/sns/messaging/lib/core/MessageAttributes.java +++ b/amazon-sns-java-messaging-lib-v1/src/main/java/com/amazon/sns/messaging/lib/core/MessageAttributes.java @@ -22,7 +22,7 @@ import com.amazonaws.services.sns.model.MessageAttributeValue; // @formatter:off -public class MessageAttributes extends AbstractMessageAttributes { +class MessageAttributes extends AbstractMessageAttributes { @Override protected MessageAttributeValue getEnumMessageAttribute(final Enum value) { diff --git a/amazon-sns-java-messaging-lib-v2/src/main/java/com/amazon/sns/messaging/lib/core/MessageAttributes.java b/amazon-sns-java-messaging-lib-v2/src/main/java/com/amazon/sns/messaging/lib/core/MessageAttributes.java index b0fa0ab..903b013 100644 --- a/amazon-sns-java-messaging-lib-v2/src/main/java/com/amazon/sns/messaging/lib/core/MessageAttributes.java +++ b/amazon-sns-java-messaging-lib-v2/src/main/java/com/amazon/sns/messaging/lib/core/MessageAttributes.java @@ -23,7 +23,7 @@ import software.amazon.awssdk.services.sns.model.MessageAttributeValue; // @formatter:off -public class MessageAttributes extends AbstractMessageAttributes { +class MessageAttributes extends AbstractMessageAttributes { @Override protected MessageAttributeValue getEnumMessageAttribute(final Enum value) { diff --git a/pom.xml b/pom.xml index 053af3d..92fa70f 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,10 @@ 0.8.8 - **/amazon-sns-java-messaging-lib-template/**, + **/AbstractAmazonSnsConsumer.**, + **/AbstractAmazonSnsProducer.**, + **/ListenableFuture.**, + **/ListenableFutureRegistry.**, **/package-info.**, **/ConsumerHelper.**, **/generated-sources/**, @@ -311,7 +314,10 @@ XML - **/amazon-sns-java-messaging-lib-template/** + **/AbstractAmazonSnsConsumer.** + **/AbstractAmazonSnsProducer.** + **/ListenableFuture.** + **/ListenableFutureRegistry.** **/package-info.** **/ConsumerHelper.** **/generated-sources/** From 71c86ba0d4da3476beddb59cb70c078ae62c79bb Mon Sep 17 00:00:00 2001 From: Marcos Tischer Vallim Date: Wed, 21 Feb 2024 18:33:18 -0300 Subject: [PATCH 2/3] chore: organize code --- .github/workflows/maven.yml | 6 +++--- pom.xml | 38 +++++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 4fe17ab..d8796b0 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -32,7 +32,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: ${{ matrix.java-version }} - distribution: "corretto" + distribution: "oracle" cache: "maven" - name: Cache Maven packages uses: actions/cache@v3.0.11 @@ -55,7 +55,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: ${{ matrix.java-version }} - distribution: "corretto" + distribution: "oracle" cache: "maven" - name: Cache Maven packages uses: actions/cache@v3.0.11 @@ -76,7 +76,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: 17 - distribution: "corretto" + distribution: "oracle" cache: "maven" - name: Cache SonarQube packages uses: actions/cache@v3.0.11 diff --git a/pom.xml b/pom.xml index 92fa70f..5997f53 100644 --- a/pom.xml +++ b/pom.xml @@ -10,8 +10,6 @@ amazon-sns-java-messaging-lib - 8 - UTF-8 UTF-8 UTF-8 @@ -368,6 +366,42 @@ + + 8 + + 1.8 + + + 8 + + + + 11 + + 11 + + + 11 + + + + 17 + + 17 + + + 17 + + + + 21 + + 21 + + + 21 + + code-ql From a2d4f1555315c9715a2c3d3d47108065a8fb7a96 Mon Sep 17 00:00:00 2001 From: Marcos Tischer Vallim Date: Wed, 21 Feb 2024 18:36:39 -0300 Subject: [PATCH 3/3] chore: organize code --- .github/workflows/maven.yml | 10 +++++----- README.md | 2 +- pom.xml | 9 --------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index d8796b0..18d9eed 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -25,14 +25,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java-version: [8, 11, 17, 21] + java-version: [8, 11, 17] steps: - uses: actions/checkout@v3 - name: Set up JDK uses: actions/setup-java@v3 with: java-version: ${{ matrix.java-version }} - distribution: "oracle" + distribution: "corretto" cache: "maven" - name: Cache Maven packages uses: actions/cache@v3.0.11 @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java-version: [8, 11, 17, 21] + java-version: [8, 11, 17] needs: [build] steps: - uses: actions/checkout@v3 @@ -55,7 +55,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: ${{ matrix.java-version }} - distribution: "oracle" + distribution: "corretto" cache: "maven" - name: Cache Maven packages uses: actions/cache@v3.0.11 @@ -76,7 +76,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: 17 - distribution: "oracle" + distribution: "corretto" cache: "maven" - name: Cache SonarQube packages uses: actions/cache@v3.0.11 diff --git a/README.md b/README.md index 8307508..6d0d63b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Combine multiple requests to optimally utilise the network. Article [Martin Fowler](https://martinfowler.com) [Request Batch](https://martinfowler.com/articles/patterns-of-distributed-systems/request-batch.html) -_**Compatible JDK 8, 11, 17 and 21**_ +_**Compatible JDK 8, 11 and 17**_ _**Compatible AWS JDK v1 >= 1.12**_ diff --git a/pom.xml b/pom.xml index 5997f53..9230ee8 100644 --- a/pom.xml +++ b/pom.xml @@ -393,15 +393,6 @@ 17 - - 21 - - 21 - - - 21 - - code-ql