diff --git a/.github/workflows/gradle-versions-watchdog.yml b/.github/workflows/gradle-versions-watchdog.yml deleted file mode 100644 index 3764b07..0000000 --- a/.github/workflows/gradle-versions-watchdog.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Gradle RC Watchdog - -on: - schedule: - - cron: '0 0 13 * *' - -jobs: - check: - name: Verify the Latest Gradle Version - runs-on: ubuntu-latest - env: - GRADLE_OPTS: "-Xmx6g -Xms4g" - CI: true - - steps: - - uses: actions/checkout@v2 - - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - uses: eskatos/gradle-command-action@v1 - with: - arguments: check --stacktrace - gradle-version: rc diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 63fce03..077cefc 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -24,26 +24,13 @@ jobs: name: Check runs-on: ubuntu-latest env: - GRADLE_OPTS: "-Xmx6g -Xms4g" - CI: true COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - strategy: - fail-fast: false - matrix: - versions: - - 'check coveralls -PmicronautVersion=1.3.7 -PspockVersion=2.0-groovy-2.5 -PgroovyVersion=2.5.15 --scan' - - 'check -PmicronautVersion=2.5.13 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 --scan' - - 'migrateMicronautImports check -PmicronautVersion=3.2.1 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 --scan' steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: - java-version: '8' + java-version: 17 distribution: zulu - cache: 'gradle' - - uses: eskatos/gradle-command-action@v2 + - uses: gradle/gradle-build-action@v2 with: - arguments: ${{ matrix.versions }} - - name: Show Build Scan - if: always() - run: cat scan-journal.log + arguments: check diff --git a/.github/workflows/publish-documentation.yml b/.github/workflows/publish-documentation.yml index 387f742..62d7817 100644 --- a/.github/workflows/publish-documentation.yml +++ b/.github/workflows/publish-documentation.yml @@ -10,12 +10,10 @@ jobs: GRADLE_OPTS: "-Xmx6g -Xms4g" steps: - uses: actions/checkout@v2 - - name: Setup Java 8 - uses: actions/setup-java@v3 + - uses: actions/setup-java@v3 with: - distribution: corretto - java-version: 8 - cache: gradle + distribution: zulu + java-version: 17 - name: Get Latest Release id: latest_version uses: abatilo/release-info-action@v1.3.0 @@ -23,6 +21,6 @@ jobs: owner: agorapulse repo: micronaut-slack - name: Publish GitHub Pages - uses: eskatos/gradle-command-action@v2 + uses: gradle/gradle-build-action@v2 with: - arguments: migrateMicronautImports gitPublishPush -x groovydoc -Pversion=${{ steps.latest_version.outputs.latest_tag }}-micronaut-3.0 -Prelease=true --stacktrace -PmicronautVersion=3.2.3 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} + arguments: gitPublishPush -Pversion=${{ steps.latest_version.outputs.latest_tag }} -Prelease=true -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2cde496..5e9cfca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,12 +15,10 @@ jobs: SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v2 + - uses: actions/setup-java@v2 with: - java-version: '8' + java-version: 17 distribution: zulu - cache: 'gradle' - name: Semantic Version id: version uses: ncipollo/semantic-version-action@v1 @@ -30,24 +28,12 @@ jobs: with: fileName: 'secret.pgp' encodedString: ${{ secrets.SIGNING_SECRET_KEY_BASE64 }} - - name: Release Micronaut 1.x + - name: Release env: SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }} - uses: eskatos/gradle-command-action@v2 + uses: gradle/gradle-build-action@v2 with: - arguments: -x groovydoc publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }}-micronaut-1.0 -Prelease=true --stacktrace - - name: Release Micronaut 2.x - env: - SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }} - uses: eskatos/gradle-command-action@v2 - with: - arguments: -x groovydoc publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }}-micronaut-2.0 -Prelease=true --stacktrace -PmicronautVersion=2.5.13 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 - - name: Release Micronaut 3.x - env: - SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }} - uses: eskatos/gradle-command-action@v2 - with: - arguments: migrateMicronautImports gitPublishPush -x groovydoc -x aggregateGroovydoc publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }}-micronaut-3.0 -Prelease=true --stacktrace -PmicronautVersion=3.2.3 -PspockVersion=2.0-groovy-3.0 -PgroovyVersion=3.0.9 -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} + arguments: gitPublishPush publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }} -Prelease=true -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} ping: name: Notify Upstream Repositories runs-on: ubuntu-latest @@ -55,7 +41,8 @@ jobs: strategy: matrix: repository: - - agorapulse/agorapulse-bom + # Until everything is migrated to Micronaut 4.x + # - agorapulse/agorapulse-bom - agorapulse/agorapulse-oss steps: - uses: actions/checkout@v1 @@ -68,4 +55,4 @@ jobs: token: ${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} repository: ${{ matrix.repository }} event-type: ap-new-version-released-event - client-payload: '{ "group": "com.agorapulse", "module": "micronaut-slack", "version": "${{ steps.version.outputs.tag }}-micronaut-1.0", "property" : "micronaut.slack.version", "github" : ${{ toJson(github) }} }' + client-payload: '{ "group": "com.agorapulse", "module": "micronaut-slack", "version": "${{ steps.version.outputs.tag }}", "property" : "micronaut.slack.version", "github" : ${{ toJson(github) }} }' diff --git a/build.gradle b/build.gradle index 3456698..7f764c5 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,6 +94,14 @@ config { } docs { + javadoc { + autoLinks { + enabled = false + } + aggregate { + enabled = false + } + } groovydoc { enabled = false aggregate { @@ -126,11 +134,22 @@ allprojects { } } -projects { +gradleProjects { subprojects { dirs(['libs', 'examples']) { Project subproject -> - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } + } + + micronaut { + importMicronautPlatform = true + testRuntime 'spock' + processing { + incremental false + } + } repositories { mavenCentral() @@ -154,33 +173,14 @@ projects { } dependencies { - api platform("org.codehaus.groovy:groovy-bom:$groovyVersion") - compile platform("org.codehaus.groovy:groovy-bom:$groovyVersion") - implementation platform("org.codehaus.groovy:groovy-bom:$groovyVersion") - compileOnly platform("org.codehaus.groovy:groovy-bom:$groovyVersion") - testCompile platform("org.codehaus.groovy:groovy-bom:$groovyVersion") - testImplementation platform("org.codehaus.groovy:groovy-bom:$groovyVersion") - - annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion") annotationProcessor "io.micronaut:micronaut-inject-java" - implementation platform("io.micronaut:micronaut-bom:$micronautVersion") - implementation "io.micronaut:micronaut-runtime" - - testAnnotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion") - testAnnotationProcessor "io.micronaut:micronaut-inject-java" - - testImplementation platform("io.micronaut:micronaut-bom:$micronautVersion") - testImplementation "org.junit.jupiter:junit-jupiter-api" testImplementation "io.micronaut.test:micronaut-test-junit5" - testImplementation("org.spockframework:spock-core") - testImplementation "org.codehaus.groovy:groovy:$groovyVersion" testImplementation "io.micronaut:micronaut-inject-groovy" - testImplementation "io.micronaut.test:micronaut-test-spock" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" - testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.5.0" + testRuntimeOnly "org.junit.vintage:junit-vintage-engine" } // useful for IntelliJ @@ -207,9 +207,11 @@ projects { enabled = true } } + } - dependencies { - testImplementation group: 'org.spockframework', name: 'spock-core', version: spockVersion + dirs(['examples']){ + micronaut { + runtime 'netty' } } } diff --git a/docs/guide/guide.gradle b/docs/guide/guide.gradle index 921412f..c5536de 100644 --- a/docs/guide/guide.gradle +++ b/docs/guide/guide.gradle @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/commander/commander.gradle b/examples/commander/commander.gradle index d7d4a7f..b4632bc 100644 --- a/examples/commander/commander.gradle +++ b/examples/commander/commander.gradle @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,4 +19,5 @@ dependencies { implementation project(':micronaut-slack-http') implementation 'io.micronaut:micronaut-http-server-netty' implementation 'ch.qos.logback:logback-classic:1.4.1' + implementation 'org.yaml:snakeyaml' } diff --git a/examples/commander/src/main/java/com/agorapulse/slack/example/commander/CommandHandler.java b/examples/commander/src/main/java/com/agorapulse/slack/example/commander/CommandHandler.java index 39bc29a..d2954f7 100644 --- a/examples/commander/src/main/java/com/agorapulse/slack/example/commander/CommandHandler.java +++ b/examples/commander/src/main/java/com/agorapulse/slack/example/commander/CommandHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import com.slack.api.bolt.response.Response; import io.micronaut.core.util.StringUtils; -import javax.inject.Singleton; +import jakarta.inject.Singleton; @Singleton public class CommandHandler implements MicronautSlashCommandHandler { // <1> diff --git a/examples/commander/src/main/java/com/agorapulse/slack/example/commander/CommanderApplication.java b/examples/commander/src/main/java/com/agorapulse/slack/example/commander/CommanderApplication.java index 9b111ea..6c70256 100644 --- a/examples/commander/src/main/java/com/agorapulse/slack/example/commander/CommanderApplication.java +++ b/examples/commander/src/main/java/com/agorapulse/slack/example/commander/CommanderApplication.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/message-sender-interactive/message-sender-interactive.gradle b/examples/message-sender-interactive/message-sender-interactive.gradle index 268f8b2..b4632bc 100644 --- a/examples/message-sender-interactive/message-sender-interactive.gradle +++ b/examples/message-sender-interactive/message-sender-interactive.gradle @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -plugins { - id 'application' -} - dependencies { implementation project(':micronaut-slack-http') implementation 'io.micronaut:micronaut-http-server-netty' implementation 'ch.qos.logback:logback-classic:1.4.1' + implementation 'org.yaml:snakeyaml' } diff --git a/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/BotSavedHandler.java b/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/BotSavedHandler.java index 4f99fb2..b256dc4 100644 --- a/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/BotSavedHandler.java +++ b/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/BotSavedHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import com.agorapulse.slack.install.event.BotSavedEvent; import io.micronaut.context.event.ApplicationEventListener; -import javax.inject.Singleton; +import jakarta.inject.Singleton; @Singleton public class BotSavedHandler implements ApplicationEventListener { diff --git a/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/InteractiveMessengerApplication.java b/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/InteractiveMessengerApplication.java index 89c1d01..bed630d 100644 --- a/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/InteractiveMessengerApplication.java +++ b/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/InteractiveMessengerApplication.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/MessageActionHandler.java b/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/MessageActionHandler.java index 4cf687a..db84504 100644 --- a/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/MessageActionHandler.java +++ b/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/MessageActionHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import com.slack.api.bolt.request.builtin.BlockActionRequest; import com.slack.api.bolt.response.Response; -import javax.inject.Singleton; +import jakarta.inject.Singleton; import java.io.IOException; import java.util.Optional; import java.util.regex.Pattern; diff --git a/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/MessageSender.java b/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/MessageSender.java index c37b4ab..2d0c29f 100644 --- a/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/MessageSender.java +++ b/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/MessageSender.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ import io.micronaut.runtime.event.ApplicationStartupEvent; import io.micronaut.runtime.event.annotation.EventListener; -import javax.inject.Singleton; +import jakarta.inject.Singleton; import java.io.IOException; import java.util.List; import java.util.Optional; diff --git a/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/ReactionHandler.java b/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/ReactionHandler.java index 8e18dfb..7640020 100644 --- a/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/ReactionHandler.java +++ b/examples/message-sender-interactive/src/main/java/com/agorapulse/slack/example/sender/interactive/ReactionHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.inject.Singleton; +import jakarta.inject.Singleton; import java.io.IOException; import java.util.Optional; diff --git a/examples/message-sender/message-sender.gradle b/examples/message-sender/message-sender.gradle index 6c26219..3854024 100644 --- a/examples/message-sender/message-sender.gradle +++ b/examples/message-sender/message-sender.gradle @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -plugins { - id 'application' -} - dependencies { implementation project(':micronaut-slack-core') implementation 'ch.qos.logback:logback-classic:1.4.1' + implementation 'org.yaml:snakeyaml' } diff --git a/examples/message-sender/src/main/java/com/agorapulse/slack/example/sender/Application.java b/examples/message-sender/src/main/java/com/agorapulse/slack/example/sender/Application.java index 5a3c4c0..fbe891b 100644 --- a/examples/message-sender/src/main/java/com/agorapulse/slack/example/sender/Application.java +++ b/examples/message-sender/src/main/java/com/agorapulse/slack/example/sender/Application.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/message-sender/src/main/java/com/agorapulse/slack/example/sender/MessageSender.java b/examples/message-sender/src/main/java/com/agorapulse/slack/example/sender/MessageSender.java index 2ffa61d..d3344b6 100644 --- a/examples/message-sender/src/main/java/com/agorapulse/slack/example/sender/MessageSender.java +++ b/examples/message-sender/src/main/java/com/agorapulse/slack/example/sender/MessageSender.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import com.slack.api.methods.response.conversations.ConversationsListResponse; import com.slack.api.model.Conversation; -import javax.inject.Singleton; +import jakarta.inject.Singleton; import java.io.IOException; import java.util.Optional; diff --git a/gradle.properties b/gradle.properties index 25c7a33..4b27768 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: Apache-2.0 # -# Copyright 2022 Agorapulse. +# Copyright 2022-2023 Agorapulse. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,15 +18,12 @@ slug=agorapulse/micronaut-slack group=com.agorapulse -version=1.0.0-SNAPSHOT -kordampPluginVersion=0.46.0 +version=2.0.0-SNAPSHOT +kordampPluginVersion=0.53.0 nexusPluginVersion=1.0.0 gitPublishPluginVersion=2.1.3 -groovyVersion=2.5.14 -spockVersion=2.0-groovy-2.5 -micronautVersion=1.3.7 -gruVersion = 1.2.3 -boltVersion = 1.25.1 - -agorapulseGradlePluginsVersion = 1.4.57 +micronautVersion = 4.2.0 +micronautGradlePluginVersion = 4.2.0 +gruVersion = 2.0.4 +boltVersion = 1.36.1 diff --git a/gradle/LICENSE_HEADER b/gradle/LICENSE_HEADER index e30635f..b7948eb 100644 --- a/gradle/LICENSE_HEADER +++ b/gradle/LICENSE_HEADER @@ -1,6 +1,6 @@ SPDX-License-Identifier: Apache-2.0 -Copyright ${copyrightYear} Agorapulse. +Copyright 2022-${copyrightYear} Agorapulse. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6499169..d0d403e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/libs/micronaut-slack-core/micronaut-slack-core.gradle b/libs/micronaut-slack-core/micronaut-slack-core.gradle index 19d9ea7..917f0da 100644 --- a/libs/micronaut-slack-core/micronaut-slack-core.gradle +++ b/libs/micronaut-slack-core/micronaut-slack-core.gradle @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,22 +15,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -plugins { - id 'org.gradle.test-retry' version '1.4.1' -} dependencies { api "com.slack.api:bolt:$boltVersion" compileOnly 'com.amazonaws:aws-java-sdk-s3:1.12.153' testImplementation 'com.amazonaws:aws-java-sdk-s3:1.12.153' - testImplementation "com.agorapulse:micronaut-aws-sdk-s3:2.0.4-micronaut-${micronautVersion[0]}.0" - testImplementation "com.agorapulse:micronaut-amazon-awssdk-integration-testing:2.0.4-micronaut-${micronautVersion[0]}.0" + testImplementation "com.agorapulse:micronaut-aws-sdk-s3:3.0.1" + testImplementation "com.agorapulse:micronaut-amazon-awssdk-integration-testing:3.0.1" - if (!micronautVersion.startsWith('1')) { - compileOnly('io.micronaut.cache:micronaut-cache-core') - testImplementation('io.micronaut.cache:micronaut-cache-caffeine') - } + compileOnly('io.micronaut.cache:micronaut-cache-core') + testImplementation('io.micronaut.cache:micronaut-cache-caffeine') } test { diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/SlackConfiguration.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/SlackConfiguration.java index 97890bd..36acdab 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/SlackConfiguration.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/SlackConfiguration.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/SlackFactory.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/SlackFactory.java index 468b667..0cc397f 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/SlackFactory.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/SlackFactory.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,9 +62,9 @@ import io.micronaut.context.annotation.Secondary; import io.micronaut.core.util.StringUtils; -import javax.annotation.Nullable; -import javax.inject.Named; -import javax.inject.Singleton; +import jakarta.annotation.Nullable; +import jakarta.inject.Named; +import jakarta.inject.Singleton; import java.util.List; import java.util.Optional; import java.util.function.BiFunction; diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/CacheDuplicateEventsFilter.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/CacheDuplicateEventsFilter.java index 8aad48f..73003bc 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/CacheDuplicateEventsFilter.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/CacheDuplicateEventsFilter.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/DefaultDuplicateEventsFilter.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/DefaultDuplicateEventsFilter.java index aed2b87..8073a25 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/DefaultDuplicateEventsFilter.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/DefaultDuplicateEventsFilter.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/DuplicateEventsFilter.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/DuplicateEventsFilter.java index 420e096..cfa4ccb 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/DuplicateEventsFilter.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/DuplicateEventsFilter.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/DuplicateEventsFilterFactory.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/DuplicateEventsFilterFactory.java index 2a8cd7f..add0cf5 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/DuplicateEventsFilterFactory.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/DuplicateEventsFilterFactory.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,9 +25,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nullable; -import javax.inject.Named; -import javax.inject.Singleton; +import jakarta.annotation.Nullable; +import jakarta.inject.Named; +import jakarta.inject.Singleton; @Factory public class DuplicateEventsFilterFactory { diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/RunOnceBoltEventHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/RunOnceBoltEventHandler.java index 5244a6e..1dc6c33 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/RunOnceBoltEventHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/event/RunOnceBoltEventHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautAttachmentActionHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautAttachmentActionHandler.java index a29d1a8..171fb31 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautAttachmentActionHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautAttachmentActionHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautBlockActionHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautBlockActionHandler.java index 2b17bc6..52e423e 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautBlockActionHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautBlockActionHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautBlockSuggestionHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautBlockSuggestionHandler.java index 5316415..ba9feba 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautBlockSuggestionHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautBlockSuggestionHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautBoltEventHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautBoltEventHandler.java index db711f3..fa91d30 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautBoltEventHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautBoltEventHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautDialogCancellationHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautDialogCancellationHandler.java index 69f3c10..5f54d51 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautDialogCancellationHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautDialogCancellationHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautDialogSubmissionHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautDialogSubmissionHandler.java index 7a33012..312ad5c 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautDialogSubmissionHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautDialogSubmissionHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautDialogSuggestionHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautDialogSuggestionHandler.java index 8474d32..d58c806 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautDialogSuggestionHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautDialogSuggestionHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautGlobalShortcutHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautGlobalShortcutHandler.java index 6ebb91d..59d1d1c 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautGlobalShortcutHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautGlobalShortcutHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautMessageShortcutHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautMessageShortcutHandler.java index 94ed447..b19424f 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautMessageShortcutHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautMessageShortcutHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautSlashCommandHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautSlashCommandHandler.java index 7330c1b..bea5851 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautSlashCommandHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautSlashCommandHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautViewClosedHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautViewClosedHandler.java index 044c4eb..5df30a3 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautViewClosedHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautViewClosedHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautViewSubmissionHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautViewSubmissionHandler.java index 93e034d..d2bac44 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautViewSubmissionHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautViewSubmissionHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautWorkflowStepEditHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautWorkflowStepEditHandler.java index 005b44b..0e8323a 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautWorkflowStepEditHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautWorkflowStepEditHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautWorkflowStepExecuteHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautWorkflowStepExecuteHandler.java index 7244e8c..2e3147c 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautWorkflowStepExecuteHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautWorkflowStepExecuteHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautWorkflowStepSaveHandler.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautWorkflowStepSaveHandler.java index 3418109..90b81a8 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautWorkflowStepSaveHandler.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/handlers/MicronautWorkflowStepSaveHandler.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/ObservableInstallationService.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/ObservableInstallationService.java index cf04894..adf1d71 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/ObservableInstallationService.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/ObservableInstallationService.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/ObservableInstallationServiceFactory.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/ObservableInstallationServiceFactory.java index 464e554..f8ac449 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/ObservableInstallationServiceFactory.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/ObservableInstallationServiceFactory.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import io.micronaut.context.event.BeanCreatedEvent; import io.micronaut.context.event.BeanCreatedEventListener; -import javax.inject.Singleton; +import jakarta.inject.Singleton; @Singleton public class ObservableInstallationServiceFactory implements BeanCreatedEventListener { diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/AmazonS3InstallationEnumerationService.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/AmazonS3InstallationEnumerationService.java index 888fc9f..b166103 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/AmazonS3InstallationEnumerationService.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/AmazonS3InstallationEnumerationService.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/AmazonS3ObjectListingIterator.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/AmazonS3ObjectListingIterator.java index 09a4e75..08ebb5b 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/AmazonS3ObjectListingIterator.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/AmazonS3ObjectListingIterator.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/FileInstallationEnumerationService.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/FileInstallationEnumerationService.java index 4a08417..3b048f3 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/FileInstallationEnumerationService.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/FileInstallationEnumerationService.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/InstallationEnumerationService.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/InstallationEnumerationService.java index fdc31b4..daab7ae 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/InstallationEnumerationService.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/enumerate/InstallationEnumerationService.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/BotDeletedEvent.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/BotDeletedEvent.java index 2960138..82982da 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/BotDeletedEvent.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/BotDeletedEvent.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/BotSavedEvent.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/BotSavedEvent.java index ec3a64c..7e86236 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/BotSavedEvent.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/BotSavedEvent.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/InstallationEvent.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/InstallationEvent.java index 4b9f849..d0620f0 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/InstallationEvent.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/InstallationEvent.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/InstallerDeletedEvent.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/InstallerDeletedEvent.java index a4fd41a..8fd2606 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/InstallerDeletedEvent.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/InstallerDeletedEvent.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/InstallerSavedEvent.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/InstallerSavedEvent.java index 7c7ffe7..9539492 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/InstallerSavedEvent.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/install/event/InstallerSavedEvent.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/oauth/DistributedAppAsyncMethodsClientFactory.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/oauth/DistributedAppAsyncMethodsClientFactory.java index 7fd9191..87b6db1 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/oauth/DistributedAppAsyncMethodsClientFactory.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/oauth/DistributedAppAsyncMethodsClientFactory.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/oauth/DistributedAppMethodsClientFactory.java b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/oauth/DistributedAppMethodsClientFactory.java index f9d2f78..6cc1a4d 100644 --- a/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/oauth/DistributedAppMethodsClientFactory.java +++ b/libs/micronaut-slack-core/src/main/java/com/agorapulse/slack/oauth/DistributedAppMethodsClientFactory.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/event/CacheDuplicateEventsFilterSpec.groovy b/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/event/CacheDuplicateEventsFilterSpec.groovy index c251503..9a1f07c 100644 --- a/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/event/CacheDuplicateEventsFilterSpec.groovy +++ b/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/event/CacheDuplicateEventsFilterSpec.groovy @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,10 @@ package com.agorapulse.slack.event import io.micronaut.context.annotation.Property -import io.micronaut.test.annotation.MicronautTest +import io.micronaut.test.extensions.spock.annotation.MicronautTest import spock.lang.Specification -import javax.inject.Inject +import jakarta.inject.Inject @MicronautTest @Property(name = 'micronaut.caches.slack-events.expire-after-write', value = '1h') diff --git a/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/event/DuplicateEventsFilterSpec.groovy b/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/event/DuplicateEventsFilterSpec.groovy index ecbc77d..6df25db 100644 --- a/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/event/DuplicateEventsFilterSpec.groovy +++ b/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/event/DuplicateEventsFilterSpec.groovy @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,10 @@ */ package com.agorapulse.slack.event -import io.micronaut.test.annotation.MicronautTest +import io.micronaut.test.extensions.spock.annotation.MicronautTest import spock.lang.Specification -import javax.inject.Inject +import jakarta.inject.Inject @MicronautTest class DuplicateEventsFilterSpec extends Specification { diff --git a/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/event/RunOnceBoltEventHandlerSpec.groovy b/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/event/RunOnceBoltEventHandlerSpec.groovy index acc429c..d5deccf 100644 --- a/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/event/RunOnceBoltEventHandlerSpec.groovy +++ b/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/event/RunOnceBoltEventHandlerSpec.groovy @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/http/S3Test.java b/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/http/S3Test.java index 64d5bf0..8f4ae6c 100644 --- a/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/http/S3Test.java +++ b/libs/micronaut-slack-core/src/test/groovy/com/agorapulse/slack/http/S3Test.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,12 +24,12 @@ import com.slack.api.bolt.service.builtin.AmazonS3OAuthStateService; import io.micronaut.context.ApplicationContext; import io.micronaut.context.annotation.Property; -import io.micronaut.test.annotation.MicronautTest; +import io.micronaut.test.extensions.junit5.annotation.MicronautTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import javax.inject.Inject; +import jakarta.inject.Inject; @MicronautTest @Property(name = "slack.bucket", value = S3Test.BUCKET_NAME) diff --git a/libs/micronaut-slack-http/micronaut-slack-http.gradle b/libs/micronaut-slack-http/micronaut-slack-http.gradle index b4bbacc..7c45333 100644 --- a/libs/micronaut-slack-http/micronaut-slack-http.gradle +++ b/libs/micronaut-slack-http/micronaut-slack-http.gradle @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,15 +19,17 @@ dependencies { api project(':micronaut-slack-core') api 'io.micronaut:micronaut-http-server' - testImplementation "com.agorapulse:gru-micronaut:1.2.3" + implementation 'io.micronaut:micronaut-jackson-databind' + + testImplementation 'com.agorapulse:gru-micronaut:2.0.5' testImplementation 'io.micronaut:micronaut-http-server-netty' testImplementation 'io.micronaut:micronaut-http-client' testImplementation 'org.mockito:mockito-core:4.8.0' - testImplementation 'org.eclipse.jetty:jetty-servlet:9.2.27.v20190403' - testImplementation 'org.eclipse.jetty:jetty-server:9.2.27.v20190403' - testImplementation 'org.eclipse.jetty:jetty-webapp:9.2.27.v20190403' - testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.2' + testImplementation 'org.eclipse.jetty:jetty-servlet:11.0.18' + testImplementation 'org.eclipse.jetty:jetty-server:11.0.18' + testImplementation 'org.eclipse.jetty:jetty-webapp:11.0.18' + testImplementation 'org.apache.logging.log4j:log4j-slf4j2-impl:2.17.2' } repositories { diff --git a/libs/micronaut-slack-http/src/main/java/com/agorapulse/slack/http/SlackAppController.java b/libs/micronaut-slack-http/src/main/java/com/agorapulse/slack/http/SlackAppController.java index dc13dfa..4f6f1fc 100644 --- a/libs/micronaut-slack-http/src/main/java/com/agorapulse/slack/http/SlackAppController.java +++ b/libs/micronaut-slack-http/src/main/java/com/agorapulse/slack/http/SlackAppController.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; import io.micronaut.http.MediaType; -import io.micronaut.http.annotation.Body; import io.micronaut.http.annotation.Controller; import io.micronaut.http.annotation.Get; import io.micronaut.http.annotation.Post; @@ -49,8 +48,8 @@ public SlackAppController(App slackApp, SlackAppMicronautAdapter adapter) { } @Post(value = "/events", consumes = {MediaType.APPLICATION_FORM_URLENCODED, MediaType.APPLICATION_JSON}) - public HttpResponse events(HttpRequest request, @Body String body) throws Exception { - return adapt(request, body); + public HttpResponse events(HttpRequest request) throws Exception { + return adapt(request, request.getBody().orElse(null)); } @Get("/install") diff --git a/libs/micronaut-slack-http/src/main/java/com/agorapulse/slack/http/SlackAppMicronautAdapter.java b/libs/micronaut-slack-http/src/main/java/com/agorapulse/slack/http/SlackAppMicronautAdapter.java index 639cb6d..e799b6d 100644 --- a/libs/micronaut-slack-http/src/main/java/com/agorapulse/slack/http/SlackAppMicronautAdapter.java +++ b/libs/micronaut-slack-http/src/main/java/com/agorapulse/slack/http/SlackAppMicronautAdapter.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ import io.micronaut.http.HttpStatus; import io.micronaut.http.MutableHttpResponse; -import javax.inject.Singleton; +import jakarta.inject.Singleton; import java.net.InetSocketAddress; import java.util.Collections; import java.util.List; diff --git a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/AdapterTest.java b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/AdapterTest.java index 80ce933..1605e9b 100644 --- a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/AdapterTest.java +++ b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/AdapterTest.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import com.slack.api.bolt.AppConfig; import com.slack.api.bolt.request.Request; import com.slack.api.bolt.response.Response; -import io.micronaut.core.convert.DefaultConversionService; +import io.micronaut.core.convert.ConversionService; import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; import io.micronaut.http.simple.SimpleHttpHeaders; @@ -48,11 +48,11 @@ public void toSlackRequest() { HttpRequest req = mock(HttpRequest.class); Map rawHeaders = new HashMap<>(); rawHeaders.put("X-Slack-Signature", "xxxxxxx"); - SimpleHttpHeaders headers = new SimpleHttpHeaders(rawHeaders, new DefaultConversionService()); + SimpleHttpHeaders headers = new SimpleHttpHeaders(rawHeaders, ConversionService.SHARED); when(req.getHeaders()).thenReturn(headers); Map> params = new HashMap<>(); params.put("foo", Arrays.asList("bar", "baz")); - SimpleHttpParameters parameters = new SimpleHttpParameters(params, new DefaultConversionService()); + SimpleHttpParameters parameters = new SimpleHttpParameters(params, ConversionService.SHARED); when(req.getParameters()).thenReturn(parameters); Request slackRequest = adapter.toSlackRequest(req, "token=random&ssl_check=1"); diff --git a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/AuthTestMockServer.java b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/AuthTestMockServer.java index 506a04a..6e1e52c 100644 --- a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/AuthTestMockServer.java +++ b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/AuthTestMockServer.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,13 +17,13 @@ */ package com.agorapulse.slack.http; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletHandler; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.SocketException; diff --git a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/ControllerTest.java b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/ControllerTest.java index ee4faf5..60d9096 100644 --- a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/ControllerTest.java +++ b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/ControllerTest.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import com.slack.api.SlackConfig; import com.slack.api.bolt.App; import com.slack.api.bolt.AppConfig; -import io.micronaut.core.convert.DefaultConversionService; +import io.micronaut.core.convert.ConversionService; import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; import io.micronaut.http.MutableHttpParameters; @@ -34,6 +34,7 @@ import org.junit.jupiter.api.Test; import java.util.HashMap; +import java.util.Optional; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.IsEqual.equalTo; @@ -74,12 +75,13 @@ public void test() throws Exception { assertNotNull(controller); HttpRequest req = mock(HttpRequest.class); - SimpleHttpHeaders headers = new SimpleHttpHeaders(new HashMap<>(), new DefaultConversionService()); + SimpleHttpHeaders headers = new SimpleHttpHeaders(new HashMap<>(), ConversionService.SHARED); when(req.getHeaders()).thenReturn(headers); - SimpleHttpParameters parameters = new SimpleHttpParameters(new HashMap<>(), new DefaultConversionService()); + SimpleHttpParameters parameters = new SimpleHttpParameters(new HashMap<>(), ConversionService.SHARED); when(req.getParameters()).thenReturn(parameters); + when(req.getBody()).thenReturn(Optional.of("token=random&ssl_check=1")); - HttpResponse response = controller.events(req, "token=random&ssl_check=1"); + HttpResponse response = controller.events(req); assertEquals(200, response.getStatus().getCode()); } diff --git a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/HelloCommand.java b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/HelloCommand.java index 33b86b1..2c5b78d 100644 --- a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/HelloCommand.java +++ b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/HelloCommand.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import com.slack.api.bolt.request.builtin.SlashCommandRequest; import com.slack.api.bolt.response.Response; -import javax.inject.Singleton; +import jakarta.inject.Singleton; @Singleton public class HelloCommand implements MicronautSlashCommandHandler { diff --git a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/IdiomaticTest.java b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/IdiomaticTest.java index 6318321..f7471b3 100644 --- a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/IdiomaticTest.java +++ b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/IdiomaticTest.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,30 +20,26 @@ import com.agorapulse.gru.Content; import com.agorapulse.gru.Gru; import com.agorapulse.gru.RequestDefinitionBuilder; -import com.agorapulse.gru.micronaut.Micronaut; import com.slack.api.app_backend.SlackSignature; +import io.micronaut.context.annotation.Property; +import io.micronaut.test.extensions.junit5.annotation.MicronautTest; +import jakarta.inject.Inject; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import java.util.Collections; - import static com.slack.api.app_backend.SlackSignature.HeaderNames.X_SLACK_REQUEST_TIMESTAMP; import static com.slack.api.app_backend.SlackSignature.HeaderNames.X_SLACK_SIGNATURE; +@MicronautTest(environments = "idiomatic") +@Property(name = "gru.http.client", value = "jdk") +@Property(name = "slack.signing-secret", value = IdiomaticTest.TEST_SIGNING_SECRET) public class IdiomaticTest { public static final String TEST_SIGNING_SECRET = "s3cr3t"; private static final SlackSignature.Generator SIGNATURE_GENERATOR = new SlackSignature.Generator(TEST_SIGNING_SECRET); - private final Gru gru = Gru.create( - Micronaut.build(this) - .doWithContextBuilder(builder -> builder - .environments("idiomatic") - .properties(Collections.singletonMap("slack.signing-secret", IdiomaticTest.TEST_SIGNING_SECRET)) - ) - .start() - ); + @Inject Gru gru; @AfterEach public void close() { @@ -64,9 +60,9 @@ private static void slackEventRequest(RequestDefinitionBuilder builder, String r builder.header(X_SLACK_REQUEST_TIMESTAMP, timestamp) .header(X_SLACK_SIGNATURE, signature) - .header("Content-Type", "application/json") + .header("Content-Type", "application/x-www-form-urlencoded") .param("query", "queryValue") - .json(Content.inline(requestBody)); + .content(Content.inline(requestBody), "application/x-www-form-urlencoded"); } } diff --git a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/PortProvider.java b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/PortProvider.java index ef8b72c..8647d88 100644 --- a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/PortProvider.java +++ b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/PortProvider.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/SubmissionNumberCommand.java b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/SubmissionNumberCommand.java index 5d3200a..c779e1c 100644 --- a/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/SubmissionNumberCommand.java +++ b/libs/micronaut-slack-http/src/test/groovy/com/agorapulse/slack/http/SubmissionNumberCommand.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import com.slack.api.bolt.request.builtin.SlashCommandRequest; import com.slack.api.bolt.response.Response; -import javax.inject.Singleton; +import jakarta.inject.Singleton; import java.util.regex.Pattern; @Singleton diff --git a/libs/micronaut-slack-http/src/test/resources/log4j2.xml b/libs/micronaut-slack-http/src/test/resources/log4j2.xml new file mode 100644 index 0000000..89c4f11 --- /dev/null +++ b/libs/micronaut-slack-http/src/test/resources/log4j2.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/settings.gradle b/settings.gradle index 45f5f94..3d348af 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2022 Agorapulse. + * Copyright 2022-2023 Agorapulse. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,23 +32,20 @@ buildscript { classpath group: 'org.kordamp.gradle', name: 'coveralls-gradle-plugin', version: kordampPluginVersion classpath group: 'org.ajoberstar', name: 'gradle-git-publish', version: gitPublishPluginVersion classpath group: 'io.github.gradle-nexus', name: 'publish-plugin', version: nexusPluginVersion - classpath group: 'com.agorapulse.gradle', name: 'micronaut-compatibility', version: agorapulseGradlePluginsVersion + classpath group: 'io.micronaut.gradle', name: 'micronaut-minimal-plugin', version: micronautGradlePluginVersion } } plugins { id 'org.kordamp.gradle.settings' version "$kordampPluginVersion" - id 'com.gradle.enterprise' version '3.6.1' + id 'com.gradle.enterprise' version '3.15.1' } gradleEnterprise { buildScan { + publishAlways() termsOfServiceUrl = "https://gradle.com/terms-of-service" termsOfServiceAgree = "yes" - - buildScanPublished { scan -> - file("scan-journal.log") << "${new Date()} - ${scan.buildScanId} - ${scan.buildScanUri}\n" - } } } @@ -62,10 +59,13 @@ projects { id 'org.kordamp.gradle.guide' id 'org.ajoberstar.git-publish' } - dirs(['libs', 'examples']) { - id 'java-library' + dirs(['libs']) { + id 'io.micronaut.minimal.library' + id 'groovy' + } + dirs(['examples']) { + id 'io.micronaut.minimal.application' id 'groovy' - id 'com.agorapulse.gradle.micronaut-compatibility' } } }