forked from quarkus-qe/beefy-scenarios
-
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.
Legacy non-application endpoint redirection use case (quarkus-qe#216)
quarkus.http.redirect-to-non-application-root-path deprecated property was removed It is possible to achieve the previous behavior by explicitly setting endpoints to be absolute instead of relative. For instance, the Health endpoint can be forced to be available at /health instead of /q/health by setting quarkus.smallrye-health.root-path=/health
- Loading branch information
Pablo Gonzalez Granados
authored
Jun 2, 2021
1 parent
7bfa0f6
commit 19ce4e0
Showing
8 changed files
with
40 additions
and
6 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
10 changes: 10 additions & 0 deletions
10
.../src/test/java/io/quarkus/qe/non_application/endpoint/LegacyNonApplicationEndpointIT.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,10 @@ | ||
package io.quarkus.qe.non_application.endpoint; | ||
|
||
import static io.quarkus.qe.non_application.endpoint.CommonNonAppEndpoint.NATIVE; | ||
import static io.quarkus.qe.non_application.endpoint.CommonNonAppEndpoint.QUARKUS_PROFILE; | ||
|
||
import org.junit.jupiter.api.condition.EnabledIfSystemProperty; | ||
|
||
@EnabledIfSystemProperty(named = QUARKUS_PROFILE, matches = NATIVE) | ||
public class LegacyNonApplicationEndpointIT extends LegacyNonApplicationEndpointTest { | ||
} |
29 changes: 29 additions & 0 deletions
29
...rc/test/java/io/quarkus/qe/non_application/endpoint/LegacyNonApplicationEndpointTest.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.qe.non_application.endpoint; | ||
|
||
import static io.quarkus.qe.non_application.endpoint.CommonNonAppEndpoint.IS_NATIVE; | ||
import static io.restassured.RestAssured.when; | ||
|
||
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.qe.http.non_application.endpoint.HelloResource; | ||
import io.quarkus.test.QuarkusProdModeTest; | ||
|
||
public class LegacyNonApplicationEndpointTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusProdModeTest nonApplicationEndpointScenario = new QuarkusProdModeTest() | ||
.setBuildNative(IS_NATIVE) | ||
.overrideConfigKey("quarkus.http.root-path", "/api") | ||
.overrideConfigKey("quarkus.smallrye-health.root-path", "/health") | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) | ||
.addClass(HelloResource.class)) | ||
.setRun(true); | ||
|
||
@Test | ||
protected void nonAppEndpointScenario() { | ||
when().get("/health").then().statusCode(200); | ||
} | ||
} |
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