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 returning collections in Resteasy Reactive JAXB
Fix quarkusio#33865
- Loading branch information
Showing
3 changed files
with
136 additions
and
10 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
...rc/test/java/io/quarkus/resteasy/reactive/jaxb/deployment/test/FailWhenUsingListTest.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 FailWhenUsingListTest { | ||
|
||
@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
...java/io/quarkus/resteasy/reactive/jaxb/deployment/test/FailWhenUsingRestResponseTest.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 FailWhenUsingRestResponseTest { | ||
|
||
@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<>()); | ||
} | ||
} | ||
} |