-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix consistency of SmallRye Health config roots #42444
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the test can stay right, we just need to update the config? This test needs to be updated nevertheless. Just mentioning it so it's not removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the test will get dropped. I added another test with the updated config (but GitHub shows it to you the other way around).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now.