sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject [sling-org-apache-sling-resourceresolver] 08/24: Use Mockito instead of extra mock classes
Date Tue, 07 Nov 2017 10:00:52 GMT
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.resourceresolver-1.0.6
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git

commit d993a1c432f6d1af4e0ede4636c30e8efebf9ac3
Author: Carsten Ziegeler <cziegeler@apache.org>
AuthorDate: Fri Feb 22 15:12:42 2013 +0000

    Use Mockito instead of extra mock classes
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/resourceresolver@1449072
13f79535-47bb-0310-9956-ffa450edef68
---
 .../resourceresolver/impl/tree/ResourceProviderEntryTest.java     | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/test/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntryTest.java
b/src/test/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntryTest.java
index bb4f6d3..06fb4ee 100644
--- a/src/test/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntryTest.java
+++ b/src/test/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntryTest.java
@@ -41,17 +41,15 @@ public class ResourceProviderEntryTest {
 
     private ResourceResolver rootResolver;
 
-    private ResourceProvider rootProvider;
-
     private ResourceProviderEntry root;
 
     @Before public void setUp() throws Exception {
         this.rootResolver = Mockito.mock(ResourceResolver.class);
-        this.rootProvider = Mockito.mock(ResourceProvider.class);
-        Mockito.when(this.rootProvider.getResource(Mockito.any(ResourceResolver.class), Mockito.anyString())).thenReturn(new
TestResource(this.rootResolver));
+        final ResourceProvider rootProvider = Mockito.mock(ResourceProvider.class);
+        Mockito.when(rootProvider.getResource(Mockito.any(ResourceResolver.class), Mockito.anyString())).thenReturn(new
TestResource(this.rootResolver));
         final Map<String, Object> props = new HashMap<String, Object>();
         props.put(Constants.SERVICE_ID, (long)0);
-        root = new ResourceProviderEntry("/", new ResourceProviderHandler[]{ new ResourceProviderHandler(rootProvider,
props)});
+        this.root = new ResourceProviderEntry("/", new ResourceProviderHandler[]{ new ResourceProviderHandler(rootProvider,
props)});
     }
 
     @Test public void testRootProvider() {

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <commits@sling.apache.org>.

Mime
View raw message