From 55cd530993e035407a66898fa0679f769b74d963 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Thu, 17 Oct 2024 10:11:07 -0300 Subject: [PATCH] Split and Reuse the Release workflow (#433) --- .github/workflows/pre-release.yml | 16 +++++ .github/workflows/release-perform.yml | 28 +++++++++ .github/workflows/release-prepare.yml | 18 ++++++ .github/workflows/release.yml | 63 ------------------- .../deployment/ProblemBuildConfig.java | 3 +- .../problem/deployment/ProblemProcessor.java | 17 ++--- .../deployment/ProblemProcessorTest.java | 4 +- .../devmode/PropertiesLiveReloadTest.java | 3 +- .../problem/devmode/TestMdcResource.java | 1 + .../resteasy/problem/ExceptionMapperBase.java | 5 +- .../resteasy/problem/HttpProblem.java | 6 +- .../problem/ZalandoProblemMapper.java | 4 +- .../jackson/InvalidFormatExceptionMapper.java | 13 ++-- .../JacksonProblemModuleRegistrar.java | 4 +- .../jackson/JacksonProblemSerializer.java | 6 +- .../JsonProcessingExceptionMapper.java | 6 +- .../UnrecognizedPropertyExceptionMapper.java | 8 ++- .../jaxrs/JaxRsForbiddenExceptionMapper.java | 5 +- .../jaxrs/NotFoundExceptionMapper.java | 5 +- .../jaxrs/WebApplicationExceptionMapper.java | 8 ++- .../problem/jsonb/JsonbExceptionMapper.java | 5 +- .../problem/jsonb/JsonbProblemSerializer.java | 5 +- .../RestEasyClassicJsonbExceptionMapper.java | 5 +- .../postprocessing/MdcPropertiesInjector.java | 4 +- .../MicroprofileMetricsCollector.java | 5 +- .../PostProcessorsRegistry.java | 4 +- .../problem/postprocessing/ProblemLogger.java | 4 +- .../postprocessing/ProblemPostProcessor.java | 3 +- .../postprocessing/ProblemRecorder.java | 6 +- ...thenticationCompletionExceptionMapper.java | 5 +- .../AuthenticationFailedExceptionMapper.java | 7 ++- ...ticationFailedExceptionReactiveMapper.java | 8 ++- ...AuthenticationRedirectExceptionMapper.java | 7 ++- .../security/ForbiddenExceptionMapper.java | 5 +- .../security/HttpUnauthorizedUtils.java | 3 +- .../security/UnauthorizedExceptionMapper.java | 7 ++- .../UnauthorizedExceptionReactiveMapper.java | 8 ++- .../ConstraintViolationExceptionMapper.java | 26 ++++---- .../validation/ValidationExceptionMapper.java | 5 +- .../problem/ExceptionMapperAssert.java | 4 +- .../problem/HttpProblemMapperTest.java | 1 + .../resteasy/problem/HttpProblemTest.java | 1 + .../problem/ProblemMapperBenchmark.java | 10 ++- .../problem/ZalandoProblemMapperTest.java | 1 + .../InvalidFormatExceptionMapperTest.java | 7 ++- .../jackson/JacksonProblemSerializerTest.java | 13 ++-- ...recognizedPropertyExceptionMapperTest.java | 10 ++- .../jaxrs/NotFoundExceptionMapperTest.java | 1 + .../WebApplicationExceptionMapperTest.java | 7 ++- .../jsonb/JsonbProblemSerializerTest.java | 13 ++-- ...stEasyClassicJsonbExceptionMapperTest.java | 1 + .../MdcPropertiesInjectorTest.java | 6 +- .../MicroprofileMetricsCollectorTest.java | 3 +- .../PostProcessorsRegistryTest.java | 4 +- .../ProblemDefaultsProviderTest.java | 4 +- .../postprocessing/ProblemLoggerTest.java | 6 +- ...ticationCompletionExceptionMapperTest.java | 4 +- ...thenticationFailedExceptionMapperTest.java | 6 +- ...enticationRedirectExceptionMapperTest.java | 4 +- .../ForbiddenExceptionMapperTest.java | 4 +- .../UnauthorizedExceptionMapperTest.java | 6 +- ...onstraintViolationExceptionMapperTest.java | 28 +++++---- 62 files changed, 296 insertions(+), 193 deletions(-) create mode 100644 .github/workflows/pre-release.yml create mode 100644 .github/workflows/release-perform.yml create mode 100644 .github/workflows/release-prepare.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml new file mode 100644 index 0000000..afe17b3 --- /dev/null +++ b/.github/workflows/pre-release.yml @@ -0,0 +1,16 @@ +name: Quarkiverse Pre Release + +on: + pull_request: + paths: + - '.github/project.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + pre-release: + name: Pre-Release + uses: quarkiverse/.github/.github/workflows/pre-release.yml@main + secrets: inherit diff --git a/.github/workflows/release-perform.yml b/.github/workflows/release-perform.yml new file mode 100644 index 0000000..88f9437 --- /dev/null +++ b/.github/workflows/release-perform.yml @@ -0,0 +1,28 @@ +name: Quarkiverse Perform Release +run-name: Perform ${{github.event.inputs.tag || github.ref_name}} Release +on: + push: + tags: + - '*' + workflow_dispatch: + inputs: + tag: + description: 'Tag to release' + required: true + +permissions: + attestations: write + id-token: write + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + perform-release: + name: Perform Release + uses: quarkiverse/.github/.github/workflows/perform-release.yml@main + secrets: inherit + with: + version: ${{github.event.inputs.tag || github.ref_name}} diff --git a/.github/workflows/release-prepare.yml b/.github/workflows/release-prepare.yml new file mode 100644 index 0000000..aedad93 --- /dev/null +++ b/.github/workflows/release-prepare.yml @@ -0,0 +1,18 @@ +name: Quarkiverse Prepare Release + +on: + pull_request: + types: [ closed ] + paths: + - '.github/project.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + prepare-release: + name: Prepare Release + if: ${{ github.event.pull_request.merged == true}} + uses: quarkiverse/.github/.github/workflows/prepare-release.yml@main + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index b3612b8..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Quarkiverse Release - -on: - workflow_dispatch: - pull_request: - types: [closed] - paths: - - '.github/project.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -defaults: - run: - shell: bash - -jobs: - release: - runs-on: ubuntu-latest - name: release - if: ${{github.event.pull_request.merged == true}} - - steps: - - uses: radcortez/project-metadata-action@main - name: Retrieve project metadata - id: metadata - with: - github-token: ${{secrets.GITHUB_TOKEN}} - metadata-file-path: '.github/project.yml' - - - uses: actions/checkout@v4 - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 17 - cache: 'maven' - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE - - - name: Configure Git author - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - - - name: Maven release ${{steps.metadata.outputs.current-version}} - run: | - mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} - mvn -B release:perform -Darguments=-DperformRelease -DperformRelease -Prelease -Pquick -pl '!integration-test' - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - - - name: Push changes and tag - run: | - git push - git push --tags \ No newline at end of file diff --git a/deployment/src/main/java/io/quarkiverse/resteasy/problem/deployment/ProblemBuildConfig.java b/deployment/src/main/java/io/quarkiverse/resteasy/problem/deployment/ProblemBuildConfig.java index 3b0581c..64070fc 100644 --- a/deployment/src/main/java/io/quarkiverse/resteasy/problem/deployment/ProblemBuildConfig.java +++ b/deployment/src/main/java/io/quarkiverse/resteasy/problem/deployment/ProblemBuildConfig.java @@ -1,11 +1,12 @@ package io.quarkiverse.resteasy.problem.deployment; +import java.util.Set; + import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; import io.smallrye.config.ConfigMapping; import io.smallrye.config.WithDefault; import io.smallrye.config.WithName; -import java.util.Set; @ConfigMapping(prefix = "quarkus.resteasy.problem") @ConfigRoot(phase = ConfigPhase.BUILD_TIME) diff --git a/deployment/src/main/java/io/quarkiverse/resteasy/problem/deployment/ProblemProcessor.java b/deployment/src/main/java/io/quarkiverse/resteasy/problem/deployment/ProblemProcessor.java index 990f237..76c6911 100644 --- a/deployment/src/main/java/io/quarkiverse/resteasy/problem/deployment/ProblemProcessor.java +++ b/deployment/src/main/java/io/quarkiverse/resteasy/problem/deployment/ProblemProcessor.java @@ -4,6 +4,16 @@ import static io.quarkus.deployment.annotations.ExecutionTime.RUNTIME_INIT; import static io.quarkus.deployment.annotations.ExecutionTime.STATIC_INIT; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import jakarta.ws.rs.Priorities; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import io.quarkiverse.resteasy.problem.ProblemRuntimeConfig; import io.quarkiverse.resteasy.problem.postprocessing.ProblemPostProcessor; import io.quarkiverse.resteasy.problem.postprocessing.ProblemRecorder; @@ -20,13 +30,6 @@ import io.quarkus.resteasy.common.spi.ResteasyJaxrsProviderBuildItem; import io.quarkus.resteasy.reactive.spi.CustomExceptionMapperBuildItem; import io.quarkus.resteasy.reactive.spi.ExceptionMapperBuildItem; -import jakarta.ws.rs.Priorities; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class ProblemProcessor { diff --git a/deployment/src/test/java/io/quarkiverse/resteasy/problem/deployment/ProblemProcessorTest.java b/deployment/src/test/java/io/quarkiverse/resteasy/problem/deployment/ProblemProcessorTest.java index 613e710..ade7759 100644 --- a/deployment/src/test/java/io/quarkiverse/resteasy/problem/deployment/ProblemProcessorTest.java +++ b/deployment/src/test/java/io/quarkiverse/resteasy/problem/deployment/ProblemProcessorTest.java @@ -6,11 +6,13 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import io.quarkus.deployment.Capabilities; import java.util.Collections; + import org.junit.jupiter.api.Test; import org.slf4j.Logger; +import io.quarkus.deployment.Capabilities; + class ProblemProcessorTest { static final Capabilities CAPABILITIES_WITH_JSON = new Capabilities(Collections.singleton("io.quarkus.jackson")); diff --git a/deployment/src/test/java/io/quarkiverse/resteasy/problem/devmode/PropertiesLiveReloadTest.java b/deployment/src/test/java/io/quarkiverse/resteasy/problem/devmode/PropertiesLiveReloadTest.java index 06271e9..2fb714e 100644 --- a/deployment/src/test/java/io/quarkiverse/resteasy/problem/devmode/PropertiesLiveReloadTest.java +++ b/deployment/src/test/java/io/quarkiverse/resteasy/problem/devmode/PropertiesLiveReloadTest.java @@ -4,12 +4,13 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; -import io.quarkus.test.QuarkusDevModeTest; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import io.quarkus.test.QuarkusDevModeTest; + public class PropertiesLiveReloadTest { static final String ORIGINAL_PROPERTY_NAME = "field-from-configuration"; diff --git a/deployment/src/test/java/io/quarkiverse/resteasy/problem/devmode/TestMdcResource.java b/deployment/src/test/java/io/quarkiverse/resteasy/problem/devmode/TestMdcResource.java index da600a4..1688ed0 100644 --- a/deployment/src/test/java/io/quarkiverse/resteasy/problem/devmode/TestMdcResource.java +++ b/deployment/src/test/java/io/quarkiverse/resteasy/problem/devmode/TestMdcResource.java @@ -4,6 +4,7 @@ import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; + import org.slf4j.MDC; @Path("/throw-exception") diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/ExceptionMapperBase.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/ExceptionMapperBase.java index 28c811c..39d1edb 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/ExceptionMapperBase.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/ExceptionMapperBase.java @@ -1,12 +1,13 @@ package io.quarkiverse.resteasy.problem; -import io.quarkiverse.resteasy.problem.postprocessing.PostProcessorsRegistry; -import io.quarkiverse.resteasy.problem.postprocessing.ProblemContext; import jakarta.ws.rs.core.Context; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.UriInfo; import jakarta.ws.rs.ext.ExceptionMapper; +import io.quarkiverse.resteasy.problem.postprocessing.PostProcessorsRegistry; +import io.quarkiverse.resteasy.problem.postprocessing.ProblemContext; + /** * Base class for all ExceptionMappers in this extension, takes care of mapping Exceptions to Problems, triggering * post-processing stage, and creating final JaxRS Response. diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/HttpProblem.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/HttpProblem.java index 24c3821..1a1b2e5 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/HttpProblem.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/HttpProblem.java @@ -1,7 +1,5 @@ package io.quarkiverse.resteasy.problem; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; import java.net.URI; import java.util.Arrays; import java.util.Collections; @@ -13,9 +11,13 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; + import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; + /** * Representation of RFC7807 Problem schema. */ diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/ZalandoProblemMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/ZalandoProblemMapper.java index 3ae19e7..2aeb8d8 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/ZalandoProblemMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/ZalandoProblemMapper.java @@ -1,9 +1,11 @@ package io.quarkiverse.resteasy.problem; +import java.util.Optional; + import jakarta.annotation.Priority; import jakarta.ws.rs.Priorities; import jakarta.ws.rs.core.Response; -import java.util.Optional; + import org.zalando.problem.ThrowableProblem; /** diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/InvalidFormatExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/InvalidFormatExceptionMapper.java index dafe992..746b844 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/InvalidFormatExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/InvalidFormatExceptionMapper.java @@ -1,14 +1,17 @@ package io.quarkiverse.resteasy.problem.jackson; +import java.util.List; +import java.util.stream.Collectors; + +import jakarta.annotation.Priority; +import jakarta.ws.rs.Priorities; +import jakarta.ws.rs.core.Response; + import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.exc.InvalidFormatException; + import io.quarkiverse.resteasy.problem.ExceptionMapperBase; import io.quarkiverse.resteasy.problem.HttpProblem; -import jakarta.annotation.Priority; -import jakarta.ws.rs.Priorities; -import jakarta.ws.rs.core.Response; -import java.util.List; -import java.util.stream.Collectors; /** * Mapper for Jackson InvalidFormatException, which is more specialised version of JsonProcessingException diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/JacksonProblemModuleRegistrar.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/JacksonProblemModuleRegistrar.java index 28e7545..c6af164 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/JacksonProblemModuleRegistrar.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/JacksonProblemModuleRegistrar.java @@ -1,10 +1,12 @@ package io.quarkiverse.resteasy.problem.jackson; +import jakarta.inject.Singleton; + import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.module.SimpleModule; + import io.quarkiverse.resteasy.problem.HttpProblem; import io.quarkus.jackson.ObjectMapperCustomizer; -import jakarta.inject.Singleton; @Singleton public final class JacksonProblemModuleRegistrar implements ObjectMapperCustomizer { diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/JacksonProblemSerializer.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/JacksonProblemSerializer.java index 3a91d60..e62277e 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/JacksonProblemSerializer.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/JacksonProblemSerializer.java @@ -1,12 +1,14 @@ package io.quarkiverse.resteasy.problem.jackson; +import java.io.IOException; +import java.util.Map; + import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.std.StdSerializer; + import io.quarkiverse.resteasy.problem.HttpProblem; import io.quarkiverse.resteasy.problem.InstanceUtils; -import java.io.IOException; -import java.util.Map; /** * Low level Jackson serializer for HttpProblem type. diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/JsonProcessingExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/JsonProcessingExceptionMapper.java index 81bd63a..024477a 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/JsonProcessingExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/JsonProcessingExceptionMapper.java @@ -2,11 +2,13 @@ import static jakarta.ws.rs.core.Response.Status.BAD_REQUEST; +import jakarta.annotation.Priority; +import jakarta.ws.rs.Priorities; + import com.fasterxml.jackson.core.JsonProcessingException; + import io.quarkiverse.resteasy.problem.ExceptionMapperBase; import io.quarkiverse.resteasy.problem.HttpProblem; -import jakarta.annotation.Priority; -import jakarta.ws.rs.Priorities; /** * Mapper for Jackson payload processing exceptions. diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/UnrecognizedPropertyExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/UnrecognizedPropertyExceptionMapper.java index 026eba1..0fad040 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/UnrecognizedPropertyExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jackson/UnrecognizedPropertyExceptionMapper.java @@ -1,12 +1,14 @@ package io.quarkiverse.resteasy.problem.jackson; -import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException; -import io.quarkiverse.resteasy.problem.ExceptionMapperBase; -import io.quarkiverse.resteasy.problem.HttpProblem; import jakarta.annotation.Priority; import jakarta.ws.rs.Priorities; import jakarta.ws.rs.core.Response; +import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException; + +import io.quarkiverse.resteasy.problem.ExceptionMapperBase; +import io.quarkiverse.resteasy.problem.HttpProblem; + /** * UnrecognizedPropertyException is thrown by Jackson, when request payload json does not fit DTO object with @Valid annotation * (e.g field has different name) and FAIL_ON_UNKNOWN_PROPERTIES is enabled (default changed in quarkus 1.11) diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jaxrs/JaxRsForbiddenExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jaxrs/JaxRsForbiddenExceptionMapper.java index 9b1fb10..2fbd778 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jaxrs/JaxRsForbiddenExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jaxrs/JaxRsForbiddenExceptionMapper.java @@ -2,12 +2,13 @@ import static jakarta.ws.rs.core.Response.Status.FORBIDDEN; -import io.quarkiverse.resteasy.problem.ExceptionMapperBase; -import io.quarkiverse.resteasy.problem.HttpProblem; import jakarta.annotation.Priority; import jakarta.ws.rs.ForbiddenException; import jakarta.ws.rs.Priorities; +import io.quarkiverse.resteasy.problem.ExceptionMapperBase; +import io.quarkiverse.resteasy.problem.HttpProblem; + /** * Mapper overriding default Quarkus exception mapper to make all error responses compliant with RFC7807. * diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jaxrs/NotFoundExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jaxrs/NotFoundExceptionMapper.java index 693127b..8c13b6d 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jaxrs/NotFoundExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jaxrs/NotFoundExceptionMapper.java @@ -2,12 +2,13 @@ import static jakarta.ws.rs.core.Response.Status.NOT_FOUND; -import io.quarkiverse.resteasy.problem.ExceptionMapperBase; -import io.quarkiverse.resteasy.problem.HttpProblem; import jakarta.annotation.Priority; import jakarta.ws.rs.NotFoundException; import jakarta.ws.rs.Priorities; +import io.quarkiverse.resteasy.problem.ExceptionMapperBase; +import io.quarkiverse.resteasy.problem.HttpProblem; + @Priority(Priorities.USER) public final class NotFoundExceptionMapper extends ExceptionMapperBase { diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jaxrs/WebApplicationExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jaxrs/WebApplicationExceptionMapper.java index e1d073c..7c1ca61 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jaxrs/WebApplicationExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jaxrs/WebApplicationExceptionMapper.java @@ -1,12 +1,14 @@ package io.quarkiverse.resteasy.problem.jaxrs; -import io.quarkiverse.resteasy.problem.ExceptionMapperBase; -import io.quarkiverse.resteasy.problem.HttpProblem; +import java.util.Optional; + import jakarta.annotation.Priority; import jakarta.ws.rs.Priorities; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; -import java.util.Optional; + +import io.quarkiverse.resteasy.problem.ExceptionMapperBase; +import io.quarkiverse.resteasy.problem.HttpProblem; /** * Generic exception mapper for JaxRS WebApplicationExceptions - it passes status and message to application/problem response. diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jsonb/JsonbExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jsonb/JsonbExceptionMapper.java index 78f4429..0e2255b 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jsonb/JsonbExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jsonb/JsonbExceptionMapper.java @@ -2,12 +2,13 @@ import static jakarta.ws.rs.core.Response.Status.BAD_REQUEST; -import io.quarkiverse.resteasy.problem.ExceptionMapperBase; -import io.quarkiverse.resteasy.problem.HttpProblem; import jakarta.annotation.Priority; import jakarta.json.bind.JsonbException; import jakarta.ws.rs.Priorities; +import io.quarkiverse.resteasy.problem.ExceptionMapperBase; +import io.quarkiverse.resteasy.problem.HttpProblem; + @Priority(Priorities.USER) public final class JsonbExceptionMapper extends ExceptionMapperBase { diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jsonb/JsonbProblemSerializer.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jsonb/JsonbProblemSerializer.java index 83163db..8de8236 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jsonb/JsonbProblemSerializer.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jsonb/JsonbProblemSerializer.java @@ -1,11 +1,12 @@ package io.quarkiverse.resteasy.problem.jsonb; -import io.quarkiverse.resteasy.problem.HttpProblem; -import io.quarkiverse.resteasy.problem.InstanceUtils; import jakarta.json.bind.serializer.JsonbSerializer; import jakarta.json.bind.serializer.SerializationContext; import jakarta.json.stream.JsonGenerator; +import io.quarkiverse.resteasy.problem.HttpProblem; +import io.quarkiverse.resteasy.problem.InstanceUtils; + /** * Low level JsonB serializer for Problem type. */ diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jsonb/RestEasyClassicJsonbExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jsonb/RestEasyClassicJsonbExceptionMapper.java index 9f18e98..1c5ccc6 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/jsonb/RestEasyClassicJsonbExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/jsonb/RestEasyClassicJsonbExceptionMapper.java @@ -3,12 +3,13 @@ import static jakarta.ws.rs.core.Response.Status.BAD_REQUEST; import static jakarta.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR; -import io.quarkiverse.resteasy.problem.ExceptionMapperBase; -import io.quarkiverse.resteasy.problem.HttpProblem; import jakarta.annotation.Priority; import jakarta.ws.rs.Priorities; import jakarta.ws.rs.ProcessingException; +import io.quarkiverse.resteasy.problem.ExceptionMapperBase; +import io.quarkiverse.resteasy.problem.HttpProblem; + @Priority(Priorities.USER) public final class RestEasyClassicJsonbExceptionMapper extends ExceptionMapperBase { diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/MdcPropertiesInjector.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/MdcPropertiesInjector.java index 27dccac..aac0cbe 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/MdcPropertiesInjector.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/MdcPropertiesInjector.java @@ -1,10 +1,12 @@ package io.quarkiverse.resteasy.problem.postprocessing; -import io.quarkiverse.resteasy.problem.HttpProblem; import java.util.Collections; import java.util.Set; + import org.slf4j.MDC; +import io.quarkiverse.resteasy.problem.HttpProblem; + /** * Injects existing MDC properties listed in the configuration into final response. Missing MDC values and properties already * defined in Problem instance are skipped. diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/MicroprofileMetricsCollector.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/MicroprofileMetricsCollector.java index b066630..4a70d04 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/MicroprofileMetricsCollector.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/MicroprofileMetricsCollector.java @@ -1,11 +1,12 @@ package io.quarkiverse.resteasy.problem.postprocessing; -import io.quarkiverse.resteasy.problem.HttpProblem; -import io.smallrye.metrics.MetricRegistries; import org.eclipse.microprofile.metrics.Metadata; import org.eclipse.microprofile.metrics.MetricRegistry; import org.eclipse.microprofile.metrics.Tag; +import io.quarkiverse.resteasy.problem.HttpProblem; +import io.smallrye.metrics.MetricRegistries; + /** * Provides simple metrics to Microprofile Metrics Registry. Example result: * diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/PostProcessorsRegistry.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/PostProcessorsRegistry.java index b4190df..b661b30 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/PostProcessorsRegistry.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/PostProcessorsRegistry.java @@ -1,10 +1,12 @@ package io.quarkiverse.resteasy.problem.postprocessing; -import io.quarkiverse.resteasy.problem.HttpProblem; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; + import org.slf4j.LoggerFactory; +import io.quarkiverse.resteasy.problem.HttpProblem; + /** * Container for prioritised list of Problem post-processors. This class is thread-safe. */ diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemLogger.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemLogger.java index 3ce7e23..9167924 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemLogger.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemLogger.java @@ -1,13 +1,15 @@ package io.quarkiverse.resteasy.problem.postprocessing; -import io.quarkiverse.resteasy.problem.HttpProblem; import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.Stream; + import org.slf4j.Logger; +import io.quarkiverse.resteasy.problem.HttpProblem; + /** * Logs problems with ERROR (for HTTP 5XX) or INFO (other exceptions) log level. In case of ERROR (HTTP 5XX) stack trace is * printed as well. diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemPostProcessor.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemPostProcessor.java index a54102e..1cfb65a 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemPostProcessor.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemPostProcessor.java @@ -1,8 +1,9 @@ package io.quarkiverse.resteasy.problem.postprocessing; -import io.quarkiverse.resteasy.problem.HttpProblem; import java.util.Comparator; +import io.quarkiverse.resteasy.problem.HttpProblem; + /** * Post-processors use, change or enhance HttpProblem created by ExceptionMappers via 'apply' method, before they get * passed on to serializers. diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemRecorder.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemRecorder.java index 556e480..0ed4af7 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemRecorder.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemRecorder.java @@ -1,11 +1,13 @@ package io.quarkiverse.resteasy.problem.postprocessing; +import java.util.Set; + +import jakarta.enterprise.inject.spi.CDI; + import io.quarkiverse.resteasy.problem.ExceptionMapperBase; import io.quarkiverse.resteasy.problem.ProblemRuntimeConfig; import io.quarkiverse.resteasy.problem.validation.ConstraintViolationExceptionMapper; import io.quarkus.runtime.annotations.Recorder; -import jakarta.enterprise.inject.spi.CDI; -import java.util.Set; /** * Quarkus Recorder that applies configuration in the runtime. diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationCompletionExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationCompletionExceptionMapper.java index 323e83f..3858960 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationCompletionExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationCompletionExceptionMapper.java @@ -2,11 +2,12 @@ import static jakarta.ws.rs.core.Response.Status.UNAUTHORIZED; +import jakarta.annotation.Priority; +import jakarta.ws.rs.Priorities; + import io.quarkiverse.resteasy.problem.ExceptionMapperBase; import io.quarkiverse.resteasy.problem.HttpProblem; import io.quarkus.security.AuthenticationCompletionException; -import jakarta.annotation.Priority; -import jakarta.ws.rs.Priorities; /** * Mapper overriding default Quarkus exception mapper to make all error responses compliant with RFC7807.
diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationFailedExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationFailedExceptionMapper.java index 030f95c..f78e9bc 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationFailedExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationFailedExceptionMapper.java @@ -1,12 +1,13 @@ package io.quarkiverse.resteasy.problem.security; +import jakarta.annotation.Priority; +import jakarta.enterprise.inject.spi.CDI; +import jakarta.ws.rs.Priorities; + import io.quarkiverse.resteasy.problem.ExceptionMapperBase; import io.quarkiverse.resteasy.problem.HttpProblem; import io.quarkus.security.AuthenticationFailedException; import io.quarkus.vertx.http.runtime.CurrentVertxRequest; -import jakarta.annotation.Priority; -import jakarta.enterprise.inject.spi.CDI; -import jakarta.ws.rs.Priorities; /** * Mapper overriding default Quarkus exception mapper to make all error responses compliant with RFC7807. diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationFailedExceptionReactiveMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationFailedExceptionReactiveMapper.java index 6ddba53..da38d63 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationFailedExceptionReactiveMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationFailedExceptionReactiveMapper.java @@ -1,14 +1,16 @@ package io.quarkiverse.resteasy.problem.security; +import jakarta.ws.rs.Priorities; +import jakarta.ws.rs.core.Response; + +import org.jboss.resteasy.reactive.server.ServerExceptionMapper; + import io.quarkiverse.resteasy.problem.ExceptionMapperBase; import io.quarkiverse.resteasy.problem.HttpProblem; import io.quarkiverse.resteasy.problem.postprocessing.ProblemContext; import io.quarkus.security.AuthenticationFailedException; import io.smallrye.mutiny.Uni; import io.vertx.ext.web.RoutingContext; -import jakarta.ws.rs.Priorities; -import jakarta.ws.rs.core.Response; -import org.jboss.resteasy.reactive.server.ServerExceptionMapper; /** * Mapper overriding default Quarkus exception mapper to make all error responses compliant with RFC7807. diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationRedirectExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationRedirectExceptionMapper.java index aa4a3bb..9bac1cc 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationRedirectExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/AuthenticationRedirectExceptionMapper.java @@ -1,12 +1,13 @@ package io.quarkiverse.resteasy.problem.security; -import io.quarkiverse.resteasy.problem.ExceptionMapperBase; -import io.quarkiverse.resteasy.problem.HttpProblem; -import io.quarkus.security.AuthenticationRedirectException; import jakarta.annotation.Priority; import jakarta.ws.rs.Priorities; import jakarta.ws.rs.core.HttpHeaders; +import io.quarkiverse.resteasy.problem.ExceptionMapperBase; +import io.quarkiverse.resteasy.problem.HttpProblem; +import io.quarkus.security.AuthenticationRedirectException; + /** * Mapper overriding default Quarkus exception mapper to make all error responses compliant with RFC7807. * diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/ForbiddenExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/ForbiddenExceptionMapper.java index ede7135..3450fa3 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/ForbiddenExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/ForbiddenExceptionMapper.java @@ -2,11 +2,12 @@ import static jakarta.ws.rs.core.Response.Status.FORBIDDEN; +import jakarta.annotation.Priority; +import jakarta.ws.rs.Priorities; + import io.quarkiverse.resteasy.problem.ExceptionMapperBase; import io.quarkiverse.resteasy.problem.HttpProblem; import io.quarkus.security.ForbiddenException; -import jakarta.annotation.Priority; -import jakarta.ws.rs.Priorities; /** * Mapper overriding default Quarkus exception mapper to make all error responses compliant with RFC7807. diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/HttpUnauthorizedUtils.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/HttpUnauthorizedUtils.java index 73cc5c7..3573e78 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/HttpUnauthorizedUtils.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/HttpUnauthorizedUtils.java @@ -2,12 +2,13 @@ import static jakarta.ws.rs.core.Response.Status.UNAUTHORIZED; +import jakarta.ws.rs.core.Response; + import io.quarkiverse.resteasy.problem.HttpProblem; import io.quarkus.vertx.http.runtime.security.ChallengeData; import io.quarkus.vertx.http.runtime.security.HttpAuthenticator; import io.smallrye.mutiny.Uni; import io.vertx.ext.web.RoutingContext; -import jakarta.ws.rs.core.Response; final class HttpUnauthorizedUtils { diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/UnauthorizedExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/UnauthorizedExceptionMapper.java index 3e04c57..1d0d654 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/UnauthorizedExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/UnauthorizedExceptionMapper.java @@ -1,12 +1,13 @@ package io.quarkiverse.resteasy.problem.security; +import jakarta.annotation.Priority; +import jakarta.enterprise.inject.spi.CDI; +import jakarta.ws.rs.Priorities; + import io.quarkiverse.resteasy.problem.ExceptionMapperBase; import io.quarkiverse.resteasy.problem.HttpProblem; import io.quarkus.security.UnauthorizedException; import io.quarkus.vertx.http.runtime.CurrentVertxRequest; -import jakarta.annotation.Priority; -import jakarta.enterprise.inject.spi.CDI; -import jakarta.ws.rs.Priorities; /** * Mapper overriding default Quarkus exception mapper to make all error responses compliant with RFC7807. diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/UnauthorizedExceptionReactiveMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/UnauthorizedExceptionReactiveMapper.java index 5cd3edd..0732053 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/UnauthorizedExceptionReactiveMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/security/UnauthorizedExceptionReactiveMapper.java @@ -1,14 +1,16 @@ package io.quarkiverse.resteasy.problem.security; +import jakarta.ws.rs.Priorities; +import jakarta.ws.rs.core.Response; + +import org.jboss.resteasy.reactive.server.ServerExceptionMapper; + import io.quarkiverse.resteasy.problem.ExceptionMapperBase; import io.quarkiverse.resteasy.problem.HttpProblem; import io.quarkiverse.resteasy.problem.postprocessing.ProblemContext; import io.quarkus.security.UnauthorizedException; import io.smallrye.mutiny.Uni; import io.vertx.ext.web.RoutingContext; -import jakarta.ws.rs.Priorities; -import jakarta.ws.rs.core.Response; -import org.jboss.resteasy.reactive.server.ServerExceptionMapper; /** * Mapper overriding default Quarkus exception mapper to make all error responses compliant with RFC7807. diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/validation/ConstraintViolationExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/validation/ConstraintViolationExceptionMapper.java index fe031ad..648bb50 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/validation/ConstraintViolationExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/validation/ConstraintViolationExceptionMapper.java @@ -1,8 +1,15 @@ package io.quarkiverse.resteasy.problem.validation; -import io.quarkiverse.resteasy.problem.ExceptionMapperBase; -import io.quarkiverse.resteasy.problem.HttpProblem; -import io.quarkiverse.resteasy.problem.ProblemRuntimeConfig.ConstraintViolationMapperConfig; +import java.lang.reflect.Method; +import java.lang.reflect.Parameter; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + import jakarta.annotation.Priority; import jakarta.validation.ConstraintViolation; import jakarta.validation.ConstraintViolationException; @@ -14,15 +21,10 @@ import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.container.ResourceInfo; import jakarta.ws.rs.core.Context; -import java.lang.reflect.Method; -import java.lang.reflect.Parameter; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; + +import io.quarkiverse.resteasy.problem.ExceptionMapperBase; +import io.quarkiverse.resteasy.problem.HttpProblem; +import io.quarkiverse.resteasy.problem.ProblemRuntimeConfig.ConstraintViolationMapperConfig; /** * Exception Mapper for ConstraintViolationException from Bean Validation API. Hibernate Validator, among others throw diff --git a/runtime/src/main/java/io/quarkiverse/resteasy/problem/validation/ValidationExceptionMapper.java b/runtime/src/main/java/io/quarkiverse/resteasy/problem/validation/ValidationExceptionMapper.java index d578ef5..62f187a 100644 --- a/runtime/src/main/java/io/quarkiverse/resteasy/problem/validation/ValidationExceptionMapper.java +++ b/runtime/src/main/java/io/quarkiverse/resteasy/problem/validation/ValidationExceptionMapper.java @@ -2,12 +2,13 @@ import static jakarta.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR; -import io.quarkiverse.resteasy.problem.ExceptionMapperBase; -import io.quarkiverse.resteasy.problem.HttpProblem; import jakarta.annotation.Priority; import jakarta.validation.ValidationException; import jakarta.ws.rs.Priorities; +import io.quarkiverse.resteasy.problem.ExceptionMapperBase; +import io.quarkiverse.resteasy.problem.HttpProblem; + /** * Exception Mapper for generic ValidationException from Bean Validation API. * Unlike ConstraintViolationException these are not thrown if the input fails validation, diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/ExceptionMapperAssert.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/ExceptionMapperAssert.java index 33523f0..6100810 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/ExceptionMapperAssert.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/ExceptionMapperAssert.java @@ -1,9 +1,11 @@ package io.quarkiverse.resteasy.problem; +import java.util.Optional; + import jakarta.annotation.Priority; import jakarta.ws.rs.Priorities; import jakarta.ws.rs.ext.ExceptionMapper; -import java.util.Optional; + import org.assertj.core.api.AbstractAssert; public final class ExceptionMapperAssert extends AbstractAssert>> { diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/HttpProblemMapperTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/HttpProblemMapperTest.java index 0374eec..eeaa2b3 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/HttpProblemMapperTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/HttpProblemMapperTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import jakarta.ws.rs.core.Response; + import org.junit.jupiter.api.Test; class HttpProblemMapperTest { diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/HttpProblemTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/HttpProblemTest.java index 9133aa8..9d310a3 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/HttpProblemTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/HttpProblemTest.java @@ -5,6 +5,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import jakarta.ws.rs.core.Response; + import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/ProblemMapperBenchmark.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/ProblemMapperBenchmark.java index 832941d..21e75ea 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/ProblemMapperBenchmark.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/ProblemMapperBenchmark.java @@ -3,11 +3,11 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS; import static org.assertj.core.api.Assertions.assertThat; -import com.google.common.collect.Sets; -import io.quarkiverse.resteasy.problem.postprocessing.ProblemRecorder; -import jakarta.ws.rs.core.Response; import java.util.Collection; import java.util.concurrent.TimeUnit; + +import jakarta.ws.rs.core.Response; + import org.jboss.resteasy.specimpl.ResteasyUriInfo; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; @@ -29,6 +29,10 @@ import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; +import com.google.common.collect.Sets; + +import io.quarkiverse.resteasy.problem.postprocessing.ProblemRecorder; + /** * JMH benchmark for selected exception Mapper with all post-processors enabled + junit runner test for convenience. * JMH pro tip: run `mvn clean testCompile` to apply all JMH-related changes (this class)
diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/ZalandoProblemMapperTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/ZalandoProblemMapperTest.java index f80e629..ad93280 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/ZalandoProblemMapperTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/ZalandoProblemMapperTest.java @@ -4,6 +4,7 @@ import static org.zalando.problem.Status.BAD_REQUEST; import jakarta.ws.rs.core.Response; + import org.junit.jupiter.api.Test; import org.zalando.problem.Problem; import org.zalando.problem.ThrowableProblem; diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jackson/InvalidFormatExceptionMapperTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jackson/InvalidFormatExceptionMapperTest.java index cee861d..e893d26 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jackson/InvalidFormatExceptionMapperTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jackson/InvalidFormatExceptionMapperTest.java @@ -3,12 +3,15 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; +import jakarta.ws.rs.core.Response; + +import org.junit.jupiter.api.Test; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.exc.InvalidFormatException; + import io.quarkiverse.resteasy.problem.HttpProblem; -import jakarta.ws.rs.core.Response; -import org.junit.jupiter.api.Test; class InvalidFormatExceptionMapperTest { diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jackson/JacksonProblemSerializerTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jackson/JacksonProblemSerializerTest.java index 1470e93..d65bc60 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jackson/JacksonProblemSerializerTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jackson/JacksonProblemSerializerTest.java @@ -3,19 +3,22 @@ import static jakarta.ws.rs.core.Response.Status.NOT_FOUND; import static org.assertj.core.api.Assertions.assertThat; -import com.fasterxml.jackson.core.JsonEncoding; -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonGenerator; -import io.quarkiverse.resteasy.problem.HttpProblem; -import io.quarkiverse.resteasy.problem.HttpProblemMother; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.net.URI; import java.nio.charset.StandardCharsets; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import com.fasterxml.jackson.core.JsonEncoding; +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.core.JsonGenerator; + +import io.quarkiverse.resteasy.problem.HttpProblem; +import io.quarkiverse.resteasy.problem.HttpProblemMother; + class JacksonProblemSerializerTest { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jackson/UnrecognizedPropertyExceptionMapperTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jackson/UnrecognizedPropertyExceptionMapperTest.java index e0ce14f..fef40db 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jackson/UnrecognizedPropertyExceptionMapperTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jackson/UnrecognizedPropertyExceptionMapperTest.java @@ -4,12 +4,16 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; +import java.util.ArrayList; + +import jakarta.ws.rs.core.Response; + +import org.junit.jupiter.api.Test; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException; + import io.quarkiverse.resteasy.problem.HttpProblem; -import jakarta.ws.rs.core.Response; -import java.util.ArrayList; -import org.junit.jupiter.api.Test; class UnrecognizedPropertyExceptionMapperTest { diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jaxrs/NotFoundExceptionMapperTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jaxrs/NotFoundExceptionMapperTest.java index e495979..5de2f18 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jaxrs/NotFoundExceptionMapperTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jaxrs/NotFoundExceptionMapperTest.java @@ -4,6 +4,7 @@ import jakarta.ws.rs.NotFoundException; import jakarta.ws.rs.core.Response; + import org.junit.jupiter.api.Test; class NotFoundExceptionMapperTest { diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jaxrs/WebApplicationExceptionMapperTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jaxrs/WebApplicationExceptionMapperTest.java index 43740e6..2debd63 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jaxrs/WebApplicationExceptionMapperTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jaxrs/WebApplicationExceptionMapperTest.java @@ -5,16 +5,19 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatCode; -import io.quarkiverse.resteasy.problem.HttpProblem; +import java.net.URI; + import jakarta.ws.rs.RedirectionException; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; -import java.net.URI; + import org.jboss.resteasy.core.Headers; import org.jboss.resteasy.core.ServerResponse; import org.junit.jupiter.api.Test; +import io.quarkiverse.resteasy.problem.HttpProblem; + class WebApplicationExceptionMapperTest { static final MediaType MEDIA_TYPE_SHOULD_BE_IGNORED = MediaType.TEXT_PLAIN_TYPE; diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jsonb/JsonbProblemSerializerTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jsonb/JsonbProblemSerializerTest.java index 2668a10..f5ec910 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jsonb/JsonbProblemSerializerTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jsonb/JsonbProblemSerializerTest.java @@ -3,21 +3,24 @@ import static jakarta.ws.rs.core.Response.Status.NOT_FOUND; import static org.assertj.core.api.Assertions.assertThat; -import io.quarkiverse.resteasy.problem.HttpProblem; -import io.quarkiverse.resteasy.problem.HttpProblemMother; +import java.io.ByteArrayOutputStream; +import java.net.URI; +import java.nio.charset.StandardCharsets; + import jakarta.json.Json; import jakarta.json.bind.JsonbConfig; import jakarta.json.bind.serializer.SerializationContext; import jakarta.json.stream.JsonGenerator; -import java.io.ByteArrayOutputStream; -import java.net.URI; -import java.nio.charset.StandardCharsets; + import org.eclipse.parsson.JsonProviderImpl; import org.eclipse.yasson.internal.JsonbContext; import org.eclipse.yasson.internal.SerializationContextImpl; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import io.quarkiverse.resteasy.problem.HttpProblem; +import io.quarkiverse.resteasy.problem.HttpProblemMother; + class JsonbProblemSerializerTest { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jsonb/RestEasyClassicJsonbExceptionMapperTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jsonb/RestEasyClassicJsonbExceptionMapperTest.java index 02c5600..80962e3 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/jsonb/RestEasyClassicJsonbExceptionMapperTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/jsonb/RestEasyClassicJsonbExceptionMapperTest.java @@ -5,6 +5,7 @@ import jakarta.json.bind.JsonbException; import jakarta.ws.rs.ProcessingException; import jakarta.ws.rs.core.Response; + import org.junit.jupiter.api.Test; class RestEasyClassicJsonbExceptionMapperTest { diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/MdcPropertiesInjectorTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/MdcPropertiesInjectorTest.java index cc9228a..3060099 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/MdcPropertiesInjectorTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/MdcPropertiesInjectorTest.java @@ -6,13 +6,15 @@ import static jakarta.ws.rs.core.Response.Status.BAD_REQUEST; import static org.assertj.core.api.Assertions.assertThat; -import com.google.common.collect.Sets; -import io.quarkiverse.resteasy.problem.HttpProblem; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.slf4j.MDC; +import com.google.common.collect.Sets; + +import io.quarkiverse.resteasy.problem.HttpProblem; + class MdcPropertiesInjectorTest { static final String PROPERTY = "customProperty"; diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/MicroprofileMetricsCollectorTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/MicroprofileMetricsCollectorTest.java index 5cf2388..29c1fa2 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/MicroprofileMetricsCollectorTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/MicroprofileMetricsCollectorTest.java @@ -4,9 +4,10 @@ import static io.quarkiverse.resteasy.problem.postprocessing.ProblemContextMother.simpleContext; import static org.assertj.core.api.Assertions.assertThat; -import io.quarkiverse.resteasy.problem.HttpProblem; import org.junit.jupiter.api.Test; +import io.quarkiverse.resteasy.problem.HttpProblem; + class MicroprofileMetricsCollectorTest { ProblemPostProcessor processor = new MicroprofileMetricsCollector(); diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/PostProcessorsRegistryTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/PostProcessorsRegistryTest.java index c940570..47c6fa7 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/PostProcessorsRegistryTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/PostProcessorsRegistryTest.java @@ -4,11 +4,13 @@ import static io.quarkiverse.resteasy.problem.postprocessing.ProblemContextMother.simpleContext; import static org.assertj.core.api.Assertions.assertThat; -import io.quarkiverse.resteasy.problem.HttpProblem; import java.util.ArrayList; import java.util.List; + import org.junit.jupiter.api.Test; +import io.quarkiverse.resteasy.problem.HttpProblem; + class PostProcessorsRegistryTest { static final int HIGHEST = 11; diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemDefaultsProviderTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemDefaultsProviderTest.java index 5782770..99fd449 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemDefaultsProviderTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemDefaultsProviderTest.java @@ -5,10 +5,12 @@ import static io.quarkiverse.resteasy.problem.postprocessing.ProblemContextMother.simpleContext; import static org.assertj.core.api.Assertions.assertThat; -import io.quarkiverse.resteasy.problem.HttpProblem; import java.net.URI; + import org.junit.jupiter.api.Test; +import io.quarkiverse.resteasy.problem.HttpProblem; + class ProblemDefaultsProviderTest { ProblemDefaultsProvider processor = new ProblemDefaultsProvider(); diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemLoggerTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemLoggerTest.java index e58c931..e3860af 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemLoggerTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/postprocessing/ProblemLoggerTest.java @@ -7,13 +7,15 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import io.quarkiverse.resteasy.problem.HttpProblem; -import io.quarkiverse.resteasy.problem.validation.Violation; import java.util.Collections; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.slf4j.Logger; +import io.quarkiverse.resteasy.problem.HttpProblem; +import io.quarkiverse.resteasy.problem.validation.Violation; + class ProblemLoggerTest { Logger logger = mock(Logger.class); diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/AuthenticationCompletionExceptionMapperTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/AuthenticationCompletionExceptionMapperTest.java index 4e15ce6..cdc9df5 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/AuthenticationCompletionExceptionMapperTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/AuthenticationCompletionExceptionMapperTest.java @@ -3,10 +3,12 @@ import static io.quarkiverse.resteasy.problem.ExceptionMapperAssert.assertThat; import static org.assertj.core.api.Assertions.assertThat; -import io.quarkus.security.AuthenticationCompletionException; import jakarta.ws.rs.core.Response; + import org.junit.jupiter.api.Test; +import io.quarkus.security.AuthenticationCompletionException; + class AuthenticationCompletionExceptionMapperTest { AuthenticationCompletionExceptionMapper mapper = new AuthenticationCompletionExceptionMapper(); diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/AuthenticationFailedExceptionMapperTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/AuthenticationFailedExceptionMapperTest.java index 4594d16..fbb2fa2 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/AuthenticationFailedExceptionMapperTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/AuthenticationFailedExceptionMapperTest.java @@ -4,12 +4,14 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; -import io.quarkus.security.AuthenticationFailedException; -import io.quarkus.vertx.http.runtime.CurrentVertxRequest; import jakarta.ws.rs.core.Response; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import io.quarkus.security.AuthenticationFailedException; +import io.quarkus.vertx.http.runtime.CurrentVertxRequest; + class AuthenticationFailedExceptionMapperTest { AuthenticationFailedExceptionMapper mapper = new AuthenticationFailedExceptionMapper(); diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/AuthenticationRedirectExceptionMapperTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/AuthenticationRedirectExceptionMapperTest.java index 2c2e39c..a46b6fe 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/AuthenticationRedirectExceptionMapperTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/AuthenticationRedirectExceptionMapperTest.java @@ -3,11 +3,13 @@ import static io.quarkiverse.resteasy.problem.ExceptionMapperAssert.assertThat; import static org.assertj.core.api.Assertions.assertThat; -import io.quarkus.security.AuthenticationRedirectException; import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.Response; + import org.junit.jupiter.api.Test; +import io.quarkus.security.AuthenticationRedirectException; + class AuthenticationRedirectExceptionMapperTest { AuthenticationRedirectExceptionMapper mapper = new AuthenticationRedirectExceptionMapper(); diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/ForbiddenExceptionMapperTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/ForbiddenExceptionMapperTest.java index 213276c..5b0534e 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/ForbiddenExceptionMapperTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/ForbiddenExceptionMapperTest.java @@ -3,10 +3,12 @@ import static io.quarkiverse.resteasy.problem.ExceptionMapperAssert.assertThat; import static org.assertj.core.api.Assertions.assertThat; -import io.quarkus.security.ForbiddenException; import jakarta.ws.rs.core.Response; + import org.junit.jupiter.api.Test; +import io.quarkus.security.ForbiddenException; + class ForbiddenExceptionMapperTest { ForbiddenExceptionMapper mapper = new ForbiddenExceptionMapper(); diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/UnauthorizedExceptionMapperTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/UnauthorizedExceptionMapperTest.java index 64eb509..eb543b4 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/UnauthorizedExceptionMapperTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/security/UnauthorizedExceptionMapperTest.java @@ -4,12 +4,14 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; -import io.quarkus.security.UnauthorizedException; -import io.quarkus.vertx.http.runtime.CurrentVertxRequest; import jakarta.ws.rs.core.Response; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import io.quarkus.security.UnauthorizedException; +import io.quarkus.vertx.http.runtime.CurrentVertxRequest; + class UnauthorizedExceptionMapperTest { UnauthorizedExceptionMapper mapper = new UnauthorizedExceptionMapper(); diff --git a/runtime/src/test/java/io/quarkiverse/resteasy/problem/validation/ConstraintViolationExceptionMapperTest.java b/runtime/src/test/java/io/quarkiverse/resteasy/problem/validation/ConstraintViolationExceptionMapperTest.java index 9f6d429..6fc49a8 100644 --- a/runtime/src/test/java/io/quarkiverse/resteasy/problem/validation/ConstraintViolationExceptionMapperTest.java +++ b/runtime/src/test/java/io/quarkiverse/resteasy/problem/validation/ConstraintViolationExceptionMapperTest.java @@ -2,12 +2,13 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.BeanDescription; -import com.fasterxml.jackson.databind.JavaType; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition; -import io.quarkiverse.resteasy.problem.HttpProblem; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Set; + import jakarta.validation.ConstraintViolation; import jakarta.validation.ConstraintViolationException; import jakarta.validation.ParameterNameProvider; @@ -22,12 +23,7 @@ import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.container.ResourceInfo; import jakarta.ws.rs.core.Response; -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Set; + import org.hibernate.validator.HibernateValidator; import org.hibernate.validator.constraints.Length; import org.hibernate.validator.spi.nodenameprovider.JavaBeanProperty; @@ -36,6 +32,14 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.BeanDescription; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition; + +import io.quarkiverse.resteasy.problem.HttpProblem; + class ConstraintViolationExceptionMapperTest { final String INVALID = "a";