-
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 #42444 from gsmet/fix-smallrye-health-roots
Fix consistency of SmallRye Health config roots
- Loading branch information
Showing
7 changed files
with
94 additions
and
16 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
.../src/main/java/io/quarkus/smallrye/health/deployment/DeprecatedHealthBuildTimeConfig.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,34 @@ | ||
package io.quarkus.smallrye.health.deployment; | ||
|
||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
|
||
/** | ||
* This class is deprecated, don't add any more properties here. | ||
* | ||
* When dropping this class please make the properties in {@link SmallRyeHealthBuildTimeConfig} non optional. | ||
* | ||
* @deprecated Use {@link SmallRyeHealthBuildTimeConfig} instead. | ||
*/ | ||
@ConfigRoot(name = "health") | ||
@Deprecated(since = "3.14", forRemoval = true) | ||
public class DeprecatedHealthBuildTimeConfig { | ||
|
||
/** | ||
* Whether extensions published health check should be enabled. | ||
* | ||
* @deprecated Use {@code quarkus.smallrye-health.extensions.enabled} instead. | ||
*/ | ||
@ConfigItem(name = "extensions.enabled", defaultValue = "true") | ||
@Deprecated(since = "3.14", forRemoval = true) | ||
public boolean extensionsEnabled; | ||
|
||
/** | ||
* Whether to include the Liveness and Readiness Health endpoints in the generated OpenAPI document | ||
* | ||
* @deprecated Use {@code quarkus.smallrye-health.openapi.included} instead. | ||
*/ | ||
@ConfigItem(name = "openapi.included", defaultValue = "false") | ||
@Deprecated(since = "3.14", forRemoval = true) | ||
public boolean openapiIncluded; | ||
} |
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
40 changes: 40 additions & 0 deletions
40
...deployment/src/test/java/io/quarkus/smallrye/health/test/DeprecatedHealthOpenAPITest.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,40 @@ | ||
package io.quarkus.smallrye.health.test; | ||
|
||
import org.hamcrest.Matchers; | ||
import org.jboss.shrinkwrap.api.asset.EmptyAsset; | ||
import org.jboss.shrinkwrap.api.asset.StringAsset; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.restassured.RestAssured; | ||
|
||
@Deprecated(since = "3.14", forRemoval = true) | ||
class DeprecatedHealthOpenAPITest { | ||
|
||
private static final String OPEN_API_PATH = "/q/openapi"; | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClasses(BasicHealthCheck.class, OpenApiRoute.class) | ||
.addAsResource(new StringAsset("quarkus.health.openapi.included=true\n" | ||
+ "quarkus.smallrye-openapi.store-schema-directory=target"), "application.properties") | ||
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")); | ||
|
||
@Test | ||
void testOpenApiPathAccessResource() { | ||
|
||
RestAssured.given().header("Accept", "application/json") | ||
.when().get(OPEN_API_PATH) | ||
.then() | ||
.header("Content-Type", "application/json;charset=UTF-8") | ||
.body("paths", Matchers.hasKey("/q/health/ready")) | ||
.body("paths", Matchers.hasKey("/q/health/live")) | ||
.body("paths", Matchers.hasKey("/q/health/started")) | ||
.body("paths", Matchers.hasKey("/q/health")) | ||
.body("components.schemas.HealthCheckResponse.type", Matchers.equalTo("object")); | ||
|
||
} | ||
|
||
} |
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