-
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.
Merge pull request #15604 from gsmet/1.12.2-backports-2
1.12.2 backports 2
- Loading branch information
Showing
46 changed files
with
649 additions
and
193 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
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
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
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
13 changes: 9 additions & 4 deletions
13
...ain/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveServerConfig.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 |
---|---|---|
@@ -1,15 +1,20 @@ | ||
package io.quarkus.resteasy.reactive.server.deployment; | ||
|
||
import java.util.Optional; | ||
|
||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
|
||
@ConfigRoot(name = "rest") | ||
public class ResteasyReactiveServerConfig { | ||
|
||
/** | ||
* Set this to override the default path for JAX-RS resources if there are no | ||
* annotated application classes. | ||
* Set this to define the application path that serves as the base URI for all | ||
* JAX-RS resource URIs provided by {@code @Path} annotations when there are no | ||
* {@code @ApplicationPath} annotations defined on {@code Application} classes. | ||
* <p> | ||
* This value is always resolved relative to {@code quarkus.http.root-path}. | ||
*/ | ||
@ConfigItem(defaultValue = "/") | ||
String path; | ||
@ConfigItem | ||
Optional<String> path; | ||
} |
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
29 changes: 29 additions & 0 deletions
29
...src/test/java/io/quarkus/resteasy/reactive/server/test/path/RelativeRestPathTestCase.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,29 @@ | ||
package io.quarkus.resteasy.reactive.server.test.path; | ||
|
||
import org.hamcrest.Matchers; | ||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.restassured.RestAssured; | ||
|
||
public class RelativeRestPathTestCase { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest test = new QuarkusUnitTest() | ||
.withConfigurationResource("empty.properties") | ||
.overrideConfigKey("quarkus.rest.path", "foo") | ||
.overrideConfigKey("quarkus.http.root-path", "/app") | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) | ||
.addClass(HelloResource.class)); | ||
|
||
@Test | ||
public void testRestPath() { | ||
RestAssured.basePath = "/"; | ||
// This is expected behavior (relative path appended to HTTP root path) | ||
RestAssured.when().get("/app/foo/hello").then().body(Matchers.is("hello")); | ||
RestAssured.when().get("/app/foo/hello/nested").then().body(Matchers.is("world hello")); | ||
} | ||
} |
Oops, something went wrong.