Skip to content
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

Update SmallRye Config to 2.11.1 #27067

Merged
merged 1 commit into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<microprofile-jwt.version>1.2</microprofile-jwt.version>
<microprofile-lra.version>1.0</microprofile-lra.version>
<smallrye-common.version>1.13.0</smallrye-common.version>
<smallrye-config.version>2.11.0</smallrye-config.version>
<smallrye-config.version>2.11.1</smallrye-config.version>
<smallrye-health.version>3.2.1</smallrye-health.version>
<smallrye-metrics.version>3.0.5</smallrye-metrics.version>
<smallrye-open-api.version>2.1.23</smallrye-open-api.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@Unremovable
@ConfigMapping(prefix = "cloud")
@Prod
public interface Cloud {
@WithParentName
Server server();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package io.quarkus.it.smallrye.config;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.Payload;

@Target({ ElementType.TYPE_USE, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = Prod.Validator.class)
public @interface Prod {
String message() default "server is not prod";

Class<?>[] groups() default {};

Class<? extends Payload>[] payload() default {};

class Validator implements ConstraintValidator<Prod, Cloud> {
@Override
public boolean isValid(final Cloud value, final ConstraintValidatorContext context) {
return value.server().equals("prod");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@ void invalid() {
given().get("/server/validator/{prefix}", "cloud")
.then()
.statusCode(OK.getStatusCode())
.body("errors", hasSize(8))
.body("errors", hasSize(9))
.body("errors", hasItem("cloud.log.days must be less than or equal to 15"))
.body("errors", hasItem("cloud.cors.origins[1].port must be greater than or equal to 8000"))
.body("errors", hasItem("cloud.info.name size must be between 0 and 3"))
.body("errors", hasItem("cloud.info.code must be less than or equal to 3"))
.body("errors", hasItem("cloud.info.alias[0] size must be between 0 and 3"))
.body("errors", hasItem("cloud.info.admins.root[1].username size must be between 0 and 4"))
.body("errors", hasItem("cloud.info.firewall.accepted[1] size must be between 8 and 15"))
.body("errors", hasItem("cloud.proxy.timeout must be less than or equal to 10"));
.body("errors", hasItem("cloud.proxy.timeout must be less than or equal to 10"))
.body("errors", hasItem("server is not prod"));
}
}
2 changes: 1 addition & 1 deletion jakarta/rewrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ recipeList:
newValue: 3.0
- org.openrewrite.maven.ChangePropertyValue:
key: smallrye-config.version
newValue: 3.0.0-RC3
newValue: 3.0.0-RC4
- org.openrewrite.maven.ChangePropertyValue:
key: smallrye-fault-tolerance.version
newValue: 6.0.0-RC4
Expand Down