From 2b3082ee40360740b8d5221cc08cc428043e5caf Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Mon, 13 Mar 2017 06:45:37 +0100 Subject: [PATCH] Uses more direct message to link with proper resource bundle --- .../xwork2/validator/VisitorFieldValidatorTest.java | 7 +++---- .../resources/com/opensymphony/xwork2/TestBean.properties | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java index 70e4b3b18..a38764e78 100644 --- a/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/validator/VisitorFieldValidatorTest.java @@ -35,11 +35,10 @@ public class VisitorFieldValidatorTest extends XWorkTestCase { public void setUp() throws Exception { super.setUp(); - action = new VisitorValidatorTestAction(); - container.inject(action); + action = container.inject(VisitorValidatorTestAction.class); TestBean bean = action.getBean(); - Calendar cal = new GregorianCalendar(1900, 01, 01); + Calendar cal = new GregorianCalendar(1900, 1, 1); bean.setBirth(cal.getTime()); bean.setCount(-1); @@ -98,7 +97,7 @@ public class VisitorFieldValidatorTest extends XWorkTestCase { assertEquals(1, beanCountMessages.size()); String beanCountMessage = beanCountMessages.get(0); - assertEquals("bean: Model: Count must be between 1 and 100, current value is -1.", beanCountMessage); + assertEquals("bean: TestBean model: Count must be between 1 and 100, current value is -1.", beanCountMessage); } public void testCollectionValidation() throws Exception { diff --git a/core/src/test/resources/com/opensymphony/xwork2/TestBean.properties b/core/src/test/resources/com/opensymphony/xwork2/TestBean.properties index 86eab13dc..83a3aa945 100644 --- a/core/src/test/resources/com/opensymphony/xwork2/TestBean.properties +++ b/core/src/test/resources/com/opensymphony/xwork2/TestBean.properties @@ -1 +1 @@ -invalid.count=Model: Count must be between ${min} and ${max}, current value is ${count}. +invalid.count=TestBean model: Count must be between ${min} and ${max}, current value is ${count}.