You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2016/04/21 13:39:05 UTC
svn commit: r1740285 -
/sling/trunk/bundles/extensions/validation/it-http/src/test/java/org/apache/sling/validation/testservices/ValidationServiceTest.java
Author: kwin
Date: Thu Apr 21 11:39:05 2016
New Revision: 1740285
URL: http://svn.apache.org/viewvc?rev=1740285&view=rev
Log:
SLING-5373 include check for severity in IT
Modified:
sling/trunk/bundles/extensions/validation/it-http/src/test/java/org/apache/sling/validation/testservices/ValidationServiceTest.java
Modified: sling/trunk/bundles/extensions/validation/it-http/src/test/java/org/apache/sling/validation/testservices/ValidationServiceTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/it-http/src/test/java/org/apache/sling/validation/testservices/ValidationServiceTest.java?rev=1740285&r1=1740284&r2=1740285&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/it-http/src/test/java/org/apache/sling/validation/testservices/ValidationServiceTest.java (original)
+++ sling/trunk/bundles/extensions/validation/it-http/src/test/java/org/apache/sling/validation/testservices/ValidationServiceTest.java Thu Apr 21 11:39:05 2016
@@ -64,12 +64,13 @@ public class ValidationServiceTest exten
String content = re.getContent();
JSONObject jsonResponse = new JSONObject(content);
assertFalse(jsonResponse.getBoolean("valid"));
- // TODO: check validation failure
JSONObject failure = jsonResponse.getJSONArray("failures").getJSONObject(0);
assertEquals("Property does not match the pattern \"^\\p{Upper}+$\".", failure.get("message"));
assertEquals("field1", failure.get("location"));
+ assertEquals(10, failure.get("severity"));
failure = jsonResponse.getJSONArray("failures").getJSONObject(1);
assertEquals("Missing required property with name \"field2\".", failure.get("message"));
assertEquals("", failure.get("location")); // location is empty as the property is not found (property name is part of the message rather)
+ assertEquals(0, failure.get("severity"));
}
}