-
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.
Fixes hibernate-validator for quarkus.locales=all
- Loading branch information
Showing
16 changed files
with
177 additions
and
81 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
19 changes: 19 additions & 0 deletions
19
integration-tests/locales/all/src/main/java/io/quarkus/locales/it/AllLocalesResource.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,7 +1,26 @@ | ||
package io.quarkus.locales.it; | ||
|
||
import jakarta.validation.constraints.Pattern; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
import org.jboss.logging.Logger; | ||
|
||
@Path("") | ||
public class AllLocalesResource extends LocalesResource { | ||
private static final Logger LOG = Logger.getLogger(AllLocalesResource.class); | ||
|
||
// @Pattern validation does nothing when placed in LocalesResource. | ||
@GET | ||
@Path("/hibernate-validator-test-validation-message-locale/{id}/") | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public Response validationMessageLocale( | ||
@Pattern(regexp = "A.*", message = "{pattern.message}") @PathParam("id") String id) { | ||
LOG.infof("Triggering test: id: %s", id); | ||
return Response.ok(id).build(); | ||
} | ||
} |
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
1 change: 1 addition & 0 deletions
1
integration-tests/locales/all/src/test/resources/ValidationMessages.properties
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 @@ | ||
pattern.message=Value is not in line with the pattern |
1 change: 1 addition & 0 deletions
1
integration-tests/locales/all/src/test/resources/ValidationMessages_hr_HR.properties
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 @@ | ||
pattern.message=Vrijednost ne zadovoljava uzorak |
1 change: 1 addition & 0 deletions
1
integration-tests/locales/all/src/test/resources/ValidationMessages_uk_UA.properties
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 @@ | ||
pattern.message=Значення не відповідає зразку |
1 change: 1 addition & 0 deletions
1
integration-tests/locales/all/src/test/resources/ValidationMessages_zh.properties
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 @@ | ||
pattern.message=數值不符合樣品 |
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
19 changes: 19 additions & 0 deletions
19
integration-tests/locales/some/src/main/java/io/quarkus/locales/it/SomeLocalesResource.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,7 +1,26 @@ | ||
package io.quarkus.locales.it; | ||
|
||
import jakarta.validation.constraints.Pattern; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
import org.jboss.logging.Logger; | ||
|
||
@Path("") | ||
public class SomeLocalesResource extends LocalesResource { | ||
private static final Logger LOG = Logger.getLogger(SomeLocalesResource.class); | ||
|
||
// @Pattern validation does nothing when placed in LocalesResource. | ||
@GET | ||
@Path("/hibernate-validator-test-validation-message-locale/{id}/") | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public Response validationMessageLocale( | ||
@Pattern(regexp = "A.*", message = "{pattern.message}") @PathParam("id") String id) { | ||
LOG.infof("Triggering test: id: %s", id); | ||
return Response.ok(id).build(); | ||
} | ||
} |
Oops, something went wrong.