sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1744362 - /sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterTest.java
Date Wed, 18 May 2016 08:49:17 GMT
Author: tommaso
Date: Wed May 18 08:49:17 2016
New Revision: 1744362

URL: http://svn.apache.org/viewvc?rev=1744362&view=rev
Log:
SLING-4075 - added test for getPackage on local exporter

Modified:
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterTest.java

Modified: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterTest.java?rev=1744362&r1=1744361&r2=1744362&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterTest.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterTest.java
Wed May 18 08:49:17 2016
@@ -42,7 +42,7 @@ import static org.mockito.Mockito.when;
 public class LocalDistributionPackageExporterTest {
 
     @Test
-    public void testDummyExport() throws Exception {
+    public void testExport() throws Exception {
         DistributionPackageBuilder packageBuilder = mock(DistributionPackageBuilder.class);
         when(packageBuilder.createPackage(any(ResourceResolver.class), any(DistributionRequest.class))).thenReturn(mock(DistributionPackage.class));
         LocalDistributionPackageExporter localdistributionPackageExporter = new LocalDistributionPackageExporter(packageBuilder);
@@ -58,4 +58,14 @@ public class LocalDistributionPackageExp
         assertNotNull(distributionPackages);
         assertEquals(1, distributionPackages.size());
     }
+
+    @Test
+    public void testGetPackage() throws Exception {
+        DistributionPackageBuilder packageBuilder = mock(DistributionPackageBuilder.class);
+        when(packageBuilder.getPackage(any(ResourceResolver.class), any(String.class))).thenReturn(mock(DistributionPackage.class));
+        LocalDistributionPackageExporter localdistributionPackageExporter = new LocalDistributionPackageExporter(packageBuilder);
+        ResourceResolver resourceResolver = mock(ResourceResolver.class);
+        DistributionPackage distributionPackage = localdistributionPackageExporter.getPackage(resourceResolver,
"123");
+        assertNotNull(distributionPackage);
+    }
 }



Mime
View raw message