wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r1512035 - /wink/2.x/trunk/wink-bv-server/src/test/java/org/apache/wink/test/bv/server/internal/validation/bv/BeanValidationIntegrationTest.java
Date Thu, 08 Aug 2013 21:12:59 GMT
Author: gpetracek
Date: Thu Aug  8 21:12:58 2013
New Revision: 1512035

URL: http://svn.apache.org/r1512035
Log:
WINK-401 fixed default locale for checking the error message

Modified:
    wink/2.x/trunk/wink-bv-server/src/test/java/org/apache/wink/test/bv/server/internal/validation/bv/BeanValidationIntegrationTest.java

Modified: wink/2.x/trunk/wink-bv-server/src/test/java/org/apache/wink/test/bv/server/internal/validation/bv/BeanValidationIntegrationTest.java
URL: http://svn.apache.org/viewvc/wink/2.x/trunk/wink-bv-server/src/test/java/org/apache/wink/test/bv/server/internal/validation/bv/BeanValidationIntegrationTest.java?rev=1512035&r1=1512034&r2=1512035&view=diff
==============================================================================
--- wink/2.x/trunk/wink-bv-server/src/test/java/org/apache/wink/test/bv/server/internal/validation/bv/BeanValidationIntegrationTest.java
(original)
+++ wink/2.x/trunk/wink-bv-server/src/test/java/org/apache/wink/test/bv/server/internal/validation/bv/BeanValidationIntegrationTest.java
Thu Aug  8 21:12:58 2013
@@ -31,8 +31,13 @@ import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
+import java.util.Locale;
 
 public class BeanValidationIntegrationTest extends MockServletInvocationTest {
+    static {
+        Locale.setDefault(Locale.ENGLISH);
+    }
+
     private static final String GET = "GET";
 
     private static final String BASE_PATH1 = "/test1";
@@ -86,8 +91,7 @@ public class BeanValidationIntegrationTe
                 MockRequestConstructor.constructMockRequest(GET, BASE_PATH1 + "/" + MISSING_METHOD_PARAMETER_VALUE_PATH,
MediaType.TEXT_PLAIN);
         MockHttpServletResponse response = invoke(request);
         assertEquals(400, response.getStatus());
-        assertTrue(response.getContentAsString().contains("'parameterValidation.arg0'"));
-        assertTrue(response.getContentAsString().contains(" null "));
+        assertTrue(response.getContentAsString().contains("'parameterValidation.arg0' may
not be null"));
     }
 
     @Test
@@ -96,8 +100,7 @@ public class BeanValidationIntegrationTe
                 MockRequestConstructor.constructMockRequest(GET, BASE_PATH1 + "/" + RETURN_VALUE_VALIDATION_PATH,
MediaType.TEXT_PLAIN);
         MockHttpServletResponse response = invoke(request);
         assertEquals(500, response.getStatus());
-        assertTrue(response.getContentAsString().contains("'returnValueValidation.<return
value>'"));
-        assertTrue(response.getContentAsString().contains(" null "));
+        assertTrue(response.getContentAsString().contains("'returnValueValidation.<return
value>' may not be null"));
     }
 
     @Test
@@ -106,7 +109,6 @@ public class BeanValidationIntegrationTe
                 MockRequestConstructor.constructMockRequest(GET, BASE_PATH2 + "/" + MISSING_INJECTED_PARAMETER_VALUE_PATH,
MediaType.TEXT_PLAIN);
         MockHttpServletResponse response = invoke(request);
         assertEquals(400, response.getStatus());
-        assertTrue(response.getContentAsString().contains("'testParam'"));
-        assertTrue(response.getContentAsString().contains(" null "));
+        assertTrue(response.getContentAsString().contains("'testParam' may not be null"));
     }
 }



Mime
View raw message