You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2015/09/27 12:15:03 UTC
svn commit: r1705523 -
/sling/site/trunk/content/documentation/development/hamcrest.mdtext
Author: rombert
Date: Sun Sep 27 10:15:02 2015
New Revision: 1705523
URL: http://svn.apache.org/viewvc?rev=1705523&view=rev
Log:
More assertions for hamcrest integration
Modified:
sling/site/trunk/content/documentation/development/hamcrest.mdtext
Modified: sling/site/trunk/content/documentation/development/hamcrest.mdtext
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development/hamcrest.mdtext?rev=1705523&r1=1705522&r2=1705523&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/development/hamcrest.mdtext (original)
+++ sling/site/trunk/content/documentation/development/hamcrest.mdtext Sun Sep 27 10:15:02 2015
@@ -29,11 +29,14 @@ The class `org.apache.sling.testing.hamc
@Test
public void loadResources() {
+ Map<String, Object> expectedProperties = /* define properties */;
Resource resource = /* load resource */ null;
assertThat(resource, resourceOfType("my/app"));
- }
-
+ assertThat(resource, hasChildren("header", "body"));
+ assertThat(resource, resourceWithProps(expectedProperties));
+ }
+
}
The Slingshot sample application uses these matchers, see [SetupServiceTest.java](http://svn.apache.org/repos/asf/sling/trunk/samples/slingshot/src/test/java/org/apache/sling/sample/slingshot/impl/SetupServiceTest.java) for an example.
\ No newline at end of file