forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fail when detecting collections in Resteasy Reactive JAXB
Fix quarkusio#33865
- Loading branch information
Showing
5 changed files
with
201 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...c/test/java/io/quarkus/resteasy/reactive/jaxb/deployment/test/FailWhenReturnListTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package io.quarkus.resteasy.reactive.jaxb.deployment.test; | ||
|
||
import java.util.List; | ||
|
||
import jakarta.enterprise.inject.spi.DeploymentException; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
|
||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class FailWhenReturnListTest { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest test = new QuarkusUnitTest() | ||
.setExpectedException(DeploymentException.class) | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) | ||
.addClasses(GreetingResource.class)); | ||
|
||
@Test | ||
void shouldFailWithDeploymentException() { | ||
Assertions.fail("The test case should not be invoked as it should fail with a deployment exception."); | ||
} | ||
|
||
@Path("/greeting") | ||
public static class GreetingResource { | ||
|
||
@GET | ||
@Produces(MediaType.APPLICATION_XML) | ||
public List<String> hello() { | ||
return List.of("1", "2", "3"); | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...ava/io/quarkus/resteasy/reactive/jaxb/deployment/test/FailWhenReturnRestResponseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package io.quarkus.resteasy.reactive.jaxb.deployment.test; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import jakarta.enterprise.inject.spi.DeploymentException; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
|
||
import org.jboss.resteasy.reactive.RestResponse; | ||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class FailWhenReturnRestResponseTest { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest test = new QuarkusUnitTest() | ||
.setExpectedException(DeploymentException.class) | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) | ||
.addClasses(GreetingResource.class)); | ||
|
||
@Test | ||
void shouldFailWithDeploymentException() { | ||
Assertions.fail("The test case should not be invoked as it should fail with a deployment exception."); | ||
} | ||
|
||
@Path("/greeting") | ||
public static class GreetingResource { | ||
|
||
@GET | ||
@Produces(MediaType.APPLICATION_XML) | ||
public RestResponse<Map<String, String>> hello() { | ||
return RestResponse.ok(new HashMap<>()); | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...test/java/io/quarkus/resteasy/reactive/jaxb/deployment/test/FailWhenUseListParamTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package io.quarkus.resteasy.reactive.jaxb.deployment.test; | ||
|
||
import java.util.List; | ||
|
||
import jakarta.enterprise.inject.spi.DeploymentException; | ||
import jakarta.ws.rs.Consumes; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.core.MediaType; | ||
|
||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class FailWhenUseListParamTest { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest test = new QuarkusUnitTest() | ||
.setExpectedException(DeploymentException.class) | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) | ||
.addClasses(GreetingResource.class)); | ||
|
||
@Test | ||
void shouldFailWithDeploymentException() { | ||
Assertions.fail("The test case should not be invoked as it should fail with a deployment exception."); | ||
} | ||
|
||
@Path("/greeting") | ||
public static class GreetingResource { | ||
|
||
@POST | ||
@Consumes(MediaType.APPLICATION_XML) | ||
public String hello(List<String> items) { | ||
return "ok"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters