diff --git a/javaxval/src/main/java/org/baeldung/Customer.java b/javaxval/src/main/java/org/baeldung/Customer.java index 02a95cc546..f7f4a27b4a 100644 --- a/javaxval/src/main/java/org/baeldung/Customer.java +++ b/javaxval/src/main/java/org/baeldung/Customer.java @@ -20,6 +20,7 @@ public class Customer { @PositiveOrZero private OptionalInt numberOfOrders; + @NotBlank private Profile profile; public String getName() { diff --git a/javaxval/src/test/java/org/baeldung/ContainerValidationIntegrationTest.java b/javaxval/src/test/java/org/baeldung/ContainerValidationIntegrationTest.java index aa2cf577de..afa7c0c16c 100644 --- a/javaxval/src/test/java/org/baeldung/ContainerValidationIntegrationTest.java +++ b/javaxval/src/test/java/org/baeldung/ContainerValidationIntegrationTest.java @@ -76,7 +76,7 @@ public class ContainerValidationIntegrationTest { assertEquals(0, violations.size()); } - // @Test + @Test public void whenProfileCompanyNameBlank_thenValidationFails() { Customer customer = new Customer(); customer.setName("John"); diff --git a/javaxval/src/test/java/org/baeldung/javabeanconstraints/bigdecimal/InvoiceUnitTest.java b/javaxval/src/test/java/org/baeldung/javabeanconstraints/bigdecimal/InvoiceUnitTest.java index a07328e2fb..50206259ae 100644 --- a/javaxval/src/test/java/org/baeldung/javabeanconstraints/bigdecimal/InvoiceUnitTest.java +++ b/javaxval/src/test/java/org/baeldung/javabeanconstraints/bigdecimal/InvoiceUnitTest.java @@ -3,6 +3,7 @@ package org.baeldung.javabeanconstraints.bigdecimal; import static org.assertj.core.api.Assertions.assertThat; import java.math.BigDecimal; +import java.util.Locale; import java.util.Set; import javax.validation.ConstraintViolation; @@ -18,6 +19,8 @@ public class InvoiceUnitTest { @BeforeClass public static void setupValidatorInstance() { + Locale.setDefault(Locale.US); + validator = Validation.buildDefaultValidatorFactory() .getValidator(); } diff --git a/javaxval/src/test/java/org/baeldung/javabeanconstraints/validationgroup/RegistrationFormUnitTest.java b/javaxval/src/test/java/org/baeldung/javabeanconstraints/validationgroup/RegistrationFormUnitTest.java index efe61bf926..e0b1aa7bf8 100644 --- a/javaxval/src/test/java/org/baeldung/javabeanconstraints/validationgroup/RegistrationFormUnitTest.java +++ b/javaxval/src/test/java/org/baeldung/javabeanconstraints/validationgroup/RegistrationFormUnitTest.java @@ -2,6 +2,7 @@ package org.baeldung.javabeanconstraints.validationgroup; import static org.assertj.core.api.Assertions.assertThat; +import java.util.Locale; import java.util.Set; import javax.validation.ConstraintViolation; @@ -16,6 +17,8 @@ public class RegistrationFormUnitTest { @BeforeClass public static void setupValidatorInstance() { + Locale.setDefault(Locale.US); + validator = Validation.buildDefaultValidatorFactory() .getValidator(); }