diff --git a/plusone-validator/src/main/java/xyz/zhouxy/plusone/validator/DoublePropertyValidator.java b/plusone-validator/src/main/java/xyz/zhouxy/plusone/validator/DoublePropertyValidator.java index d3b6966..337c7ed 100644 --- a/plusone-validator/src/main/java/xyz/zhouxy/plusone/validator/DoublePropertyValidator.java +++ b/plusone-validator/src/main/java/xyz/zhouxy/plusone/validator/DoublePropertyValidator.java @@ -48,7 +48,7 @@ public class DoublePropertyValidator */ public final DoublePropertyValidator gt(final double min) { return withRule(Conditions.greaterThan(min), - "The input must be greater than '%s'.", min); + "The input must be greater than '%f'.", min); } /** @@ -105,7 +105,7 @@ public class DoublePropertyValidator */ public final DoublePropertyValidator ge(final double min) { return withRule(Conditions.greaterThanOrEqualTo(min), - "The input must be greater than or equal to '%s'.", min); + "The input must be greater than or equal to '%f'.", min); } /** @@ -162,7 +162,7 @@ public class DoublePropertyValidator */ public final DoublePropertyValidator lt(final double max) { return withRule(Conditions.lessThan(max), - "The input must be less than '%s'.", max); + "The input must be less than '%f'.", max); } /** @@ -219,7 +219,7 @@ public class DoublePropertyValidator */ public final DoublePropertyValidator le(final double max) { return withRule(Conditions.lessThanOrEqualTo(max), - "The input must be less than or equal to '%s'.", max); + "The input must be less than or equal to '%f'.", max); } /** diff --git a/plusone-validator/src/test/java/xyz/zhouxy/plusone/example/validator/DoublePropertyValidatorTests.java b/plusone-validator/src/test/java/xyz/zhouxy/plusone/example/validator/DoublePropertyValidatorTests.java index 0d4c426..7c4ee43 100644 --- a/plusone-validator/src/test/java/xyz/zhouxy/plusone/example/validator/DoublePropertyValidatorTests.java +++ b/plusone-validator/src/test/java/xyz/zhouxy/plusone/example/validator/DoublePropertyValidatorTests.java @@ -87,7 +87,7 @@ public class DoublePropertyValidatorTests { ValidationException e = assertThrows( ValidationException.class, () -> validator.validate(command)); - assertEquals(String.format("The input must be greater than '%s'.", MIN), e.getMessage()); + assertEquals(String.format("The input must be greater than '%f'.", MIN), e.getMessage()); } @ParameterizedTest @@ -196,7 +196,7 @@ public class DoublePropertyValidatorTests { ValidationException e = assertThrows( ValidationException.class, () -> validator.validate(command)); - assertEquals(String.format("The input must be greater than or equal to '%s'.", MIN), e.getMessage()); + assertEquals(String.format("The input must be greater than or equal to '%f'.", MIN), e.getMessage()); } @ParameterizedTest @@ -305,7 +305,7 @@ public class DoublePropertyValidatorTests { ValidationException e = assertThrows( ValidationException.class, () -> validator.validate(command)); - assertEquals(String.format("The input must be less than '%s'.", MAX), e.getMessage()); + assertEquals(String.format("The input must be less than '%f'.", MAX), e.getMessage()); } @ParameterizedTest @@ -414,7 +414,7 @@ public class DoublePropertyValidatorTests { ValidationException e = assertThrows( ValidationException.class, () -> validator.validate(command)); - assertEquals(String.format("The input must be less than or equal to '%s'.", MAX), e.getMessage()); + assertEquals(String.format("The input must be less than or equal to '%f'.", MAX), e.getMessage()); } @ParameterizedTest