diff --git a/terasoluna-gfw-validator/src/main/java/org/terasoluna/gfw/common/validator/constraints/Compare.java b/terasoluna-gfw-validator/src/main/java/org/terasoluna/gfw/common/validator/constraints/Compare.java index 4923e8105..1054d0300 100644 --- a/terasoluna-gfw-validator/src/main/java/org/terasoluna/gfw/common/validator/constraints/Compare.java +++ b/terasoluna-gfw-validator/src/main/java/org/terasoluna/gfw/common/validator/constraints/Compare.java @@ -124,14 +124,14 @@ enum Operator { EQUAL(CompareStrategy.EQ), /** - * Left side object must be grater than Right side object. + * Left side object must be greater than Right side object. */ - GRATER_THAN(CompareStrategy.GT), + GREATER_THAN(CompareStrategy.GT), /** - * Left side object must be grater than or equal Right side object. + * Left side object must be greater than or equal Right side object. */ - GRATER_THAN_OR_EQUAL(CompareStrategy.EQ, CompareStrategy.GT); + GREATER_THAN_OR_EQUAL(CompareStrategy.EQ, CompareStrategy.GT); /** * strategies to assert result of {@code Comparable#compareTo(Object)} as the expected. @@ -181,7 +181,7 @@ protected boolean isExpected(int comparisonResult) { }, /** - * Expected grater than ZERO. + * Expected greater than ZERO. */ GT { /** diff --git a/terasoluna-gfw-validator/src/test/java/org/terasoluna/gfw/common/validator/constraints/ByteMaxTest.java b/terasoluna-gfw-validator/src/test/java/org/terasoluna/gfw/common/validator/constraints/ByteMaxTest.java index f07ce337a..a7ca5d583 100644 --- a/terasoluna-gfw-validator/src/test/java/org/terasoluna/gfw/common/validator/constraints/ByteMaxTest.java +++ b/terasoluna-gfw-validator/src/test/java/org/terasoluna/gfw/common/validator/constraints/ByteMaxTest.java @@ -31,7 +31,7 @@ */ public class ByteMaxTest extends AbstractConstraintsTest { - private static final String MESSAGE_VALIDATION_ERROR = "must be under %d Bytes"; + private static final String MESSAGE_VALIDATION_ERROR = "must be less than or equal to %d Bytes"; @Before public void before() { diff --git a/terasoluna-gfw-validator/src/test/java/org/terasoluna/gfw/common/validator/constraints/ByteMinTest.java b/terasoluna-gfw-validator/src/test/java/org/terasoluna/gfw/common/validator/constraints/ByteMinTest.java index 042d2282d..6e7c1eafa 100644 --- a/terasoluna-gfw-validator/src/test/java/org/terasoluna/gfw/common/validator/constraints/ByteMinTest.java +++ b/terasoluna-gfw-validator/src/test/java/org/terasoluna/gfw/common/validator/constraints/ByteMinTest.java @@ -31,7 +31,7 @@ */ public class ByteMinTest extends AbstractConstraintsTest { - private static final String MESSAGE_VALIDATION_ERROR = "must be over %d Bytes"; + private static final String MESSAGE_VALIDATION_ERROR = "must be greater than or equal to %d Bytes"; @Before public void before() { diff --git a/terasoluna-gfw-validator/src/test/java/org/terasoluna/gfw/common/validator/constraints/CompareTest.java b/terasoluna-gfw-validator/src/test/java/org/terasoluna/gfw/common/validator/constraints/CompareTest.java index a4544c686..c1650d82e 100644 --- a/terasoluna-gfw-validator/src/test/java/org/terasoluna/gfw/common/validator/constraints/CompareTest.java +++ b/terasoluna-gfw-validator/src/test/java/org/terasoluna/gfw/common/validator/constraints/CompareTest.java @@ -211,13 +211,13 @@ public void testSpecifyOperatorEqual() throws Throwable { * @throws Throwable */ @Test - public void testSpecifyOperatorGraterThan() throws Throwable { + public void testSpecifyOperatorGreaterThan() throws Throwable { { form.setLeft(99); form.setRight(100); - violations = validator.validate(form, GraterThan.class); + violations = validator.validate(form, GreaterThan.class); assertThat(violations.size(), is(1)); assertThat(violations.iterator().next().getMessage(), is(String .format(MESSAGE_VALIDATION_ERROR, "left", "right"))); @@ -227,7 +227,7 @@ public void testSpecifyOperatorGraterThan() throws Throwable { form.setLeft(100); form.setRight(100); - violations = validator.validate(form, GraterThan.class); + violations = validator.validate(form, GreaterThan.class); assertThat(violations.size(), is(1)); assertThat(violations.iterator().next().getMessage(), is(String .format(MESSAGE_VALIDATION_ERROR, "left", "right"))); @@ -237,7 +237,7 @@ public void testSpecifyOperatorGraterThan() throws Throwable { form.setLeft(101); form.setRight(100); - violations = validator.validate(form, GraterThan.class); + violations = validator.validate(form, GreaterThan.class); assertThat(violations.size(), is(0)); } } @@ -247,13 +247,13 @@ public void testSpecifyOperatorGraterThan() throws Throwable { * @throws Throwable */ @Test - public void testSpecifyOperatorGraterThanOrEqual() throws Throwable { + public void testSpecifyOperatorGreaterThanOrEqual() throws Throwable { { form.setLeft(99); form.setRight(100); - violations = validator.validate(form, GraterThanOrEqual.class); + violations = validator.validate(form, GreaterThanOrEqual.class); assertThat(violations.size(), is(1)); assertThat(violations.iterator().next().getMessage(), is(String .format(MESSAGE_VALIDATION_ERROR, "left", "right"))); @@ -263,7 +263,7 @@ public void testSpecifyOperatorGraterThanOrEqual() throws Throwable { form.setLeft(100); form.setRight(100); - violations = validator.validate(form, GraterThanOrEqual.class); + violations = validator.validate(form, GreaterThanOrEqual.class); assertThat(violations.size(), is(0)); } @@ -271,7 +271,7 @@ public void testSpecifyOperatorGraterThanOrEqual() throws Throwable { form.setLeft(101); form.setRight(100); - violations = validator.validate(form, GraterThanOrEqual.class); + violations = validator.validate(form, GreaterThanOrEqual.class); assertThat(violations.size(), is(0)); } } @@ -475,15 +475,15 @@ private static interface LessThan { }; /** - * Validation group operator grater than. + * Validation group operator greater than. */ - private static interface GraterThan { + private static interface GreaterThan { }; /** - * Validation group operator grater than or equal. + * Validation group operator greater than or equal. */ - private static interface GraterThanOrEqual { + private static interface GreaterThanOrEqual { }; /** @@ -536,8 +536,8 @@ private static interface NotComparableLeft { @Compare.List({ @Compare(left = "left", right = "right", operator = Operator.EQUAL), - @Compare(left = "left", right = "right", operator = Operator.GRATER_THAN_OR_EQUAL, groups = { GraterThanOrEqual.class }), - @Compare(left = "left", right = "right", operator = Operator.GRATER_THAN, groups = { GraterThan.class }), + @Compare(left = "left", right = "right", operator = Operator.GREATER_THAN_OR_EQUAL, groups = { GreaterThanOrEqual.class }), + @Compare(left = "left", right = "right", operator = Operator.GREATER_THAN, groups = { GreaterThan.class }), @Compare(left = "left", right = "right", operator = Operator.LESS_THAN_OR_EQUAL, groups = { LessThanOrEqual.class }), @Compare(left = "left", right = "right", operator = Operator.LESS_THAN, groups = { LessThan.class }), @Compare(left = "left", right = "right", operator = Operator.EQUAL, requireBoth = true, groups = { RequireBoth.class }), diff --git a/terasoluna-gfw-validator/src/test/resources/ValidationMessages.properties b/terasoluna-gfw-validator/src/test/resources/ValidationMessages.properties index a1e713205..a438f19a5 100644 --- a/terasoluna-gfw-validator/src/test/resources/ValidationMessages.properties +++ b/terasoluna-gfw-validator/src/test/resources/ValidationMessages.properties @@ -1,5 +1,5 @@ # this file contains the default messages of JSR 303 bean validation for validations provided in the common library -org.terasoluna.gfw.common.validator.constraints.ByteMin.message = must be over {value} Bytes -org.terasoluna.gfw.common.validator.constraints.ByteMax.message = must be under {value} Bytes +org.terasoluna.gfw.common.validator.constraints.ByteMin.message = must be greater than or equal to {value} Bytes +org.terasoluna.gfw.common.validator.constraints.ByteMax.message = must be less than or equal to {value} Bytes org.terasoluna.gfw.common.validator.constraints.Compare.message = not match '{left}' and '{right}'