-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Consider build time conditions when determining the JAX-RS Application class
- Loading branch information
Showing
4 changed files
with
66 additions
and
24 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
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
52 changes: 52 additions & 0 deletions
52
...quarkus/resteasy/reactive/server/test/MultipleApplicationClassesWithBuildProfileTest.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,52 @@ | ||
package io.quarkus.resteasy.reactive.server.test; | ||
|
||
import static io.restassured.RestAssured.get; | ||
|
||
import javax.ws.rs.ApplicationPath; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.core.Application; | ||
|
||
import org.hamcrest.Matchers; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.arc.properties.IfBuildProperty; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
class MultipleApplicationClassesWithBuildProfileTest { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest runner = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClasses( | ||
Application1.class, Application2.class, TestResource.class)); | ||
|
||
@Test | ||
public void testNoAnnotation() { | ||
get("/1/test") | ||
.then() | ||
.statusCode(200) | ||
.body(Matchers.equalTo("test")); | ||
} | ||
|
||
@ApplicationPath("1") | ||
public static class Application1 extends Application { | ||
|
||
} | ||
|
||
@ApplicationPath("2") | ||
@IfBuildProperty(name = "some.prop2", stringValue = "v2") | ||
public static class Application2 extends Application { | ||
|
||
} | ||
|
||
@Path("test") | ||
public static class TestResource { | ||
|
||
@GET | ||
public String get() { | ||
return "test"; | ||
} | ||
} | ||
} |
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