This is an automated email from the ASF dual-hosted git repository. joerghoh pushed a commit to branch SLING-11558-remove-iterator in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlets-resolver.git
commit 853d139f623ce199a011829d2f58ec0062466dac Author: Jörg Hoh <[email protected]> AuthorDate: Sat Sep 24 19:32:09 2022 +0200 remove unnecessary asserts in the unit test --- .../internal/helper/LocationCollectorTest.java | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/test/java/org/apache/sling/servlets/resolver/internal/helper/LocationCollectorTest.java b/src/test/java/org/apache/sling/servlets/resolver/internal/helper/LocationCollectorTest.java index 44541f1..ecb9fd7 100644 --- a/src/test/java/org/apache/sling/servlets/resolver/internal/helper/LocationCollectorTest.java +++ b/src/test/java/org/apache/sling/servlets/resolver/internal/helper/LocationCollectorTest.java @@ -57,7 +57,6 @@ public class LocationCollectorTest extends HelperTestBase { List<String> loc = getLocations(r.getResourceType(), r.getResourceSuperType()); - assertEquals(2,loc.size()); List<String> expected = Arrays.asList("/" + resourceTypePath, // /foo/bar "/" + DEFAULT_RESOURCE_TYPE); // /sling/servlet/default assertThat(loc,is(expected)); @@ -73,7 +72,6 @@ public class LocationCollectorTest extends HelperTestBase { List<String> loc = getLocations(r.getResourceType(), r.getResourceSuperType()); - assertEquals(2,loc.size()); List<String> expected = Arrays.asList(root0 + resourceTypePath, // /apps/foo/bar root0 + DEFAULT_RESOURCE_TYPE); // /apps/sling/servlet/default assertThat(loc,is(expected)); @@ -91,7 +89,6 @@ public class LocationCollectorTest extends HelperTestBase { List<String> loc = getLocations(r.getResourceType(), r.getResourceSuperType()); - assertEquals(4,loc.size()); List<String> expected = Arrays.asList(root0 + resourceTypePath, // /apps/foo/bar root1 + resourceTypePath, // /libs/foo/bar root0 + DEFAULT_RESOURCE_TYPE, // /apps/sling/servlet/default @@ -133,7 +130,6 @@ public class LocationCollectorTest extends HelperTestBase { List<String> loc = getLocations(r.getResourceType(), r.getResourceSuperType()); - assertEquals(2,loc.size()); List<String> expected = Arrays.asList(resourceTypePath, // /foo/bar "/" + DEFAULT_RESOURCE_TYPE); // /sling/servlet/default assertThat(loc,is(expected)); @@ -154,7 +150,7 @@ public class LocationCollectorTest extends HelperTestBase { List<String> loc = getLocations(r.getResourceType(), r.getResourceSuperType()); - assertEquals(2,loc.size()); + List<String> expected = Arrays.asList(resourceTypePath, // /foo/bar root0 + DEFAULT_RESOURCE_TYPE); // /apps/sling/servlet/default assertThat(loc,is(expected)); @@ -177,7 +173,6 @@ public class LocationCollectorTest extends HelperTestBase { List<String> loc = getLocations(r.getResourceType(), r.getResourceSuperType()); - assertEquals(3,loc.size()); List<String> expected = Arrays.asList(resourceTypePath, // /foo/bar root0 + DEFAULT_RESOURCE_TYPE, // /apps/sling/servlet/default root1 + DEFAULT_RESOURCE_TYPE); // /libs/sling/servlet/default @@ -197,7 +192,6 @@ public class LocationCollectorTest extends HelperTestBase { List<String> loc = getLocations(r.getResourceType(), r.getResourceSuperType()); - assertEquals(3,loc.size()); List<String> expected = Arrays.asList("/" + resourceTypePath, // /foo/bar "/" + resourceSuperTypePath, // /foo/superBar "/" + DEFAULT_RESOURCE_TYPE); // /sling/servlet/default @@ -219,7 +213,6 @@ public class LocationCollectorTest extends HelperTestBase { List<String> loc = getLocations(r.getResourceType(), r.getResourceSuperType()); - assertEquals(3,loc.size()); List<String> expected = Arrays.asList(root0 + resourceTypePath, // /apps/foo/bar root0 + resourceSuperTypePath, // /apps/foo/superBar root0 + DEFAULT_RESOURCE_TYPE); // /apps/sling/servlet/default @@ -243,7 +236,6 @@ public class LocationCollectorTest extends HelperTestBase { List<String> loc = getLocations(r.getResourceType(), r.getResourceSuperType()); - assertEquals(6,loc.size()); List<String> expected = Arrays.asList(root0 + resourceTypePath, // /apps/foo/bar root1 + resourceTypePath, // /libs/foo/bar root0 + resourceSuperTypePath, // /apps/foo/superBar @@ -270,7 +262,6 @@ public class LocationCollectorTest extends HelperTestBase { List<String> loc = getLocations(r.getResourceType(), r.getResourceSuperType()); - assertEquals(3,loc.size()); List<String> expected = Arrays.asList(resourceTypePath, // /foo/bar "/" + resourceSuperTypePath, // /foo/superBar "/" + DEFAULT_RESOURCE_TYPE); // /sling/servlet/default @@ -296,7 +287,6 @@ public class LocationCollectorTest extends HelperTestBase { List<String> loc = getLocations(r.getResourceType(), r.getResourceSuperType()); - assertEquals(3,loc.size()); List<String> expected = Arrays.asList(resourceTypePath, // /foo/bar root0 + resourceSuperTypePath, // /apps/foo/superBar root0 + DEFAULT_RESOURCE_TYPE); // /apps/sling/servlet/default @@ -324,7 +314,6 @@ public class LocationCollectorTest extends HelperTestBase { List<String> loc = getLocations(r.getResourceType(), r.getResourceSuperType()); - assertEquals(5,loc.size()); List<String> expected = Arrays.asList(resourceTypePath, // /foo/bar root0 + resourceSuperTypePath, // /apps/foo/superBar root1 + resourceSuperTypePath, // /libs/foo/superBar @@ -343,7 +332,6 @@ public class LocationCollectorTest extends HelperTestBase { List<String> loc = getLocations("", null,""); - assertEquals(2,loc.size()); List<String> expected = Arrays.asList("/apps/","/libs/"); assertThat(loc,is(expected)); } @@ -357,7 +345,6 @@ public class LocationCollectorTest extends HelperTestBase { }); List<String> loc = getLocations("a/b", null); - assertEquals(4,loc.size()); List<String> expected = Arrays.asList(root0 + "a/b", root1 + "a/b", root0 + DEFAULT_RESOURCE_TYPE, @@ -374,8 +361,7 @@ public class LocationCollectorTest extends HelperTestBase { }); List<String> loc = getLocations("a/b", "c/d"); - - assertEquals(6,loc.size()); + List<String> expected = Arrays.asList(root0 + "a/b", root1 + "a/b", root0 + "c/d", @@ -420,9 +406,8 @@ public class LocationCollectorTest extends HelperTestBase { fail("Did not expect a persistence exception: " + e.getMessage()); } - List<String> loc = getLocations(resourceType, resourceSuperType); + List<String> loc = getLocations(resourceType, resourceSuperType); - assertEquals(4,loc.size()); List<String> expected = Arrays.asList(root1 + resourceType, // /libs/foo/bar root1 + resourceSuperType, // /libs/foo/check1 root1 + resourceSuperType2, // /libs/foo/check2
