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.
Avoid potential NPE when collecting RESTEasy Providers on Resource cl…
…asses Addresses: quarkusio#14418 (comment) (cherry picked from commit e104aa1)
- Loading branch information
Showing
2 changed files
with
42 additions
and
2 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
38 changes: 38 additions & 0 deletions
38
...assic/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/NoProducesValueTest.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,38 @@ | ||
package io.quarkus.resteasy.test; | ||
|
||
import static io.restassured.RestAssured.given; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.Response; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class NoProducesValueTest { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest runner = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClasses(TestResource.class)); | ||
|
||
@Test | ||
public void testSomething() { | ||
given().when().get("/test/hello") | ||
.then().statusCode(200); | ||
} | ||
|
||
@Produces | ||
@Path("test") | ||
public static class TestResource { | ||
|
||
@GET | ||
@Path("hello") | ||
public Response getHello() { | ||
return Response.ok().build(); | ||
} | ||
} | ||
} |