mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-05-28 14:19:38 +00:00
Fixes #37 with other default locale than english
Test in error with french default Locale: org.junit.ComparisonFailure: expected:<[ne peut pas être vide]> but was:<[may not be empty]> at org.junit.Assert.assertEquals(Assert.java:115) at org.junit.Assert.assertEquals(Assert.java:144) at org.springframework.samples.petclinic.model.ValidatorTests.emptyFirstName(ValidatorTests.java:39)
This commit is contained in:
parent
53abaf51e5
commit
076a124e0a
1 changed files with 3 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
package org.springframework.samples.petclinic.model;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.validation.ConstraintViolation;
|
||||
|
@ -10,6 +11,7 @@ import org.junit.Assert;
|
|||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
|
||||
|
@ -32,6 +34,7 @@ public class ValidatorTests {
|
|||
@Test
|
||||
public void emptyFirstName() {
|
||||
|
||||
LocaleContextHolder.setLocale(Locale.ENGLISH);
|
||||
Person person = new Person();
|
||||
person.setFirstName("");
|
||||
person.setLastName("smith");
|
||||
|
|
Loading…
Reference in a new issue