Re-enabled a disabled test and made the tests independent of machine locale
This commit is contained in:
parent
86dd449968
commit
5aba544fb8
|
@ -20,6 +20,7 @@ public class Customer {
|
|||
@PositiveOrZero
|
||||
private OptionalInt numberOfOrders;
|
||||
|
||||
@NotBlank
|
||||
private Profile profile;
|
||||
|
||||
public String getName() {
|
||||
|
|
|
@ -76,7 +76,7 @@ public class ContainerValidationIntegrationTest {
|
|||
assertEquals(0, violations.size());
|
||||
}
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
public void whenProfileCompanyNameBlank_thenValidationFails() {
|
||||
Customer customer = new Customer();
|
||||
customer.setName("John");
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue