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
|
@PositiveOrZero
|
||||||
private OptionalInt numberOfOrders;
|
private OptionalInt numberOfOrders;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
private Profile profile;
|
private Profile profile;
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class ContainerValidationIntegrationTest {
|
||||||
assertEquals(0, violations.size());
|
assertEquals(0, violations.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
@Test
|
||||||
public void whenProfileCompanyNameBlank_thenValidationFails() {
|
public void whenProfileCompanyNameBlank_thenValidationFails() {
|
||||||
Customer customer = new Customer();
|
Customer customer = new Customer();
|
||||||
customer.setName("John");
|
customer.setName("John");
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.baeldung.javabeanconstraints.bigdecimal;
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.validation.ConstraintViolation;
|
import javax.validation.ConstraintViolation;
|
||||||
|
@ -18,6 +19,8 @@ public class InvoiceUnitTest {
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setupValidatorInstance() {
|
public static void setupValidatorInstance() {
|
||||||
|
Locale.setDefault(Locale.US);
|
||||||
|
|
||||||
validator = Validation.buildDefaultValidatorFactory()
|
validator = Validation.buildDefaultValidatorFactory()
|
||||||
.getValidator();
|
.getValidator();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.baeldung.javabeanconstraints.validationgroup;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.validation.ConstraintViolation;
|
import javax.validation.ConstraintViolation;
|
||||||
|
@ -16,6 +17,8 @@ public class RegistrationFormUnitTest {
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setupValidatorInstance() {
|
public static void setupValidatorInstance() {
|
||||||
|
Locale.setDefault(Locale.US);
|
||||||
|
|
||||||
validator = Validation.buildDefaultValidatorFactory()
|
validator = Validation.buildDefaultValidatorFactory()
|
||||||
.getValidator();
|
.getValidator();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue