Skip to content
Snippets Groups Projects
Commit 076a124e authored by Antoine Rey's avatar Antoine Rey
Browse files

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)
parent 53abaf51
No related branches found
No related tags found
No related merge requests found
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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment