This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-1.8.0 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git
commit 387c8ad0ac217d73d857c91ecc160dfb33116586 Author: Stefan Seifert <[email protected]> AuthorDate: Tue Sep 13 09:33:02 2016 +0000 SLING-6049 use MapUtil from osgi-mock git-svn-id: https://svn.apache.org/repos/asf/sling/branches/testing/mocks/sling-mock-1.x@1760504 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 2 +- .../sling/testing/mock/sling/builder/ContentBuilder.java | 13 ++----------- .../mock/sling/context/ModelAdapterFactoryUtilTest.java | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index e2d1235..28239db 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.testing.osgi-mock</artifactId> - <version>1.7.2</version> + <version>1.7.3-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> diff --git a/src/main/java/org/apache/sling/testing/mock/sling/builder/ContentBuilder.java b/src/main/java/org/apache/sling/testing/mock/sling/builder/ContentBuilder.java index 6b41a30..2d74cb1 100644 --- a/src/main/java/org/apache/sling/testing/mock/sling/builder/ContentBuilder.java +++ b/src/main/java/org/apache/sling/testing/mock/sling/builder/ContentBuilder.java @@ -27,7 +27,7 @@ import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.api.resource.ResourceUtil; import org.apache.sling.api.resource.ValueMap; -import org.apache.sling.resourcebuilder.impl.MapArgsConverter; +import org.apache.sling.testing.mock.osgi.MapUtil; import com.google.common.collect.ImmutableMap; @@ -83,17 +83,8 @@ public class ContentBuilder { * @param properties Properties for resource. * @return Resource object */ - @SuppressWarnings("unchecked") public final Resource resource(String path, Object... properties) { - if (properties == null || properties.length == 0) { - return resource(path); - } - else if (properties.length == 1 && properties[0] instanceof Map) { - return resource(path, (Map<String,Object>)properties[0]); - } - else { - return resource(path, MapArgsConverter.toMap(properties)); - } + return resource(path, MapUtil.toMap(properties)); } /** diff --git a/src/test/java/org/apache/sling/testing/mock/sling/context/ModelAdapterFactoryUtilTest.java b/src/test/java/org/apache/sling/testing/mock/sling/context/ModelAdapterFactoryUtilTest.java index d935bbb..68a707d 100644 --- a/src/test/java/org/apache/sling/testing/mock/sling/context/ModelAdapterFactoryUtilTest.java +++ b/src/test/java/org/apache/sling/testing/mock/sling/context/ModelAdapterFactoryUtilTest.java @@ -55,7 +55,7 @@ public class ModelAdapterFactoryUtilTest { @Test public void testOsgiService() { - context.registerService(MimeTypeService.class, new MockMimeTypeService(), null); + context.registerService(MimeTypeService.class, new MockMimeTypeService()); OsgiServiceModel model = context.resourceResolver().adaptTo(OsgiServiceModel.class); assertNotNull(model); -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
