diff --git a/integration-test/src/test/java/io/quarkiverse/resteasy/problem/JaxRsMappersIT.java b/integration-test/src/test/java/io/quarkiverse/resteasy/problem/JaxRsMappersIT.java index 361ad2c..7f7c3e7 100644 --- a/integration-test/src/test/java/io/quarkiverse/resteasy/problem/JaxRsMappersIT.java +++ b/integration-test/src/test/java/io/quarkiverse/resteasy/problem/JaxRsMappersIT.java @@ -6,6 +6,7 @@ import static jakarta.ws.rs.core.Response.Status.NOT_FOUND; import static org.hamcrest.CoreMatchers.endsWith; import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.Matchers.equalToIgnoringCase; import static org.hamcrest.Matchers.nullValue; import io.quarkus.test.junit.QuarkusTest; @@ -38,6 +39,19 @@ void webApplicationExceptionShouldReturnGivenStatus(int status) { .body("stacktrace", nullValue()); } + @ParameterizedTest(name = "http status: {0}") + @ValueSource(ints = { 318, 499, 533 }) + void webApplicationExceptionWithUnassignedHttpStatusCodeShouldNotFail(int status) { + given() + .queryParam("status", status) + .get("/throw/jax-rs/web-application-exception") + .then() + .statusCode(status) + .body("title", equalToIgnoringCase("Unknown Code")) + .body("status", equalTo(status)) + .body("stacktrace", nullValue()); + } + @Test void webApplicationExceptionShouldReturnHeaders() { int status = 429; 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 7c1ca61..b348faa 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 @@ -18,7 +18,7 @@ public final class WebApplicationExceptionMapper extends ExceptionMapperBase