review updates

This commit is contained in:
Krzysztof Majewski 2019-09-17 09:07:47 +02:00
parent e48b29d58c
commit b3b7e78ce6
2 changed files with 9 additions and 8 deletions

View File

@ -17,12 +17,13 @@ public class MyMessageInterpolator implements MessageInterpolator {
@Override
public String interpolate(String messageTemplate, Context context) {
logger.debug("Selecting the language " + Locale.getDefault() + " for the error message.");
messageTemplate = messageTemplate.toUpperCase();
return defaultInterpolator.interpolate(messageTemplate, context, Locale.getDefault());
}
@Override
public String interpolate(String messageTemplate, Context context, Locale locale) {
messageTemplate = messageTemplate.toUpperCase();
return defaultInterpolator.interpolate(messageTemplate, context, locale);
}
}

View File

@ -10,21 +10,21 @@ public class ValidationExamples {
private static final Formatter formatter = new Formatter();
@Size(
min = 5,
max = 14,
message = "The author email '${validatedValue}' must be between {min} and {max} characters long"
min = 5,
max = 14,
message = "The author email '${validatedValue}' must be between {min} and {max} characters long"
)
private String authorEmail;
@Min(
value = 1,
message = "There must be at least {value} test{value > 1 ? 's' : ''} int the test case"
value = 1,
message = "There must be at least {value} test{value > 1 ? 's' : ''} int the test case"
)
private int testCount;
@DecimalMin(
value = "50",
message = "The code coverage ${formatter.format('%1$.2f', validatedValue)} must be higher than {value}%"
value = "50",
message = "The code coverage ${formatter.format('%1$.2f', validatedValue)} must be higher than {value}%"
)
private double codeCoverage;