ATLAS-2897: Better handling of empty zip files. Unit test fix.

Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/ab208e6b
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/ab208e6b
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/ab208e6b

Branch: refs/heads/branch-1.0
Commit: ab208e6bcdd1169cf3a1961bdaeab7012ae6c2c4
Parents: e9e012a
Author: Ashutosh Mestry <ames...@hortonworks.com>
Authored: Thu Oct 4 15:30:13 2018 -0700
Committer: Ashutosh Mestry <ames...@hortonworks.com>
Committed: Thu Nov 1 15:42:57 2018 -0700

----------------------------------------------------------------------
 .../atlas/repository/impexp/ExportServiceTest.java   | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/ab208e6b/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java
----------------------------------------------------------------------
diff --git 
a/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java
 
b/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java
index 7886a64..9f72f1b 100644
--- 
a/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java
+++ 
b/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java
@@ -218,7 +218,7 @@ public class ExportServiceTest extends ExportImportTestBase 
{
         assertNotNull(result.getSourceClusterName());
     }
 
-    @Test
+    @Test(expectedExceptions = AtlasBaseException.class)
     public void requestingEntityNotFound_NoData() throws AtlasBaseException, 
IOException {
         String requestingIP = "1.0.0.0";
         String hostName = "root";
@@ -231,11 +231,7 @@ public class ExportServiceTest extends 
ExportImportTestBase {
         Assert.assertNull(result.getData());
 
         ByteArrayInputStream bais = new 
ByteArrayInputStream(baos.toByteArray());
-        ZipSource zipSource = new ZipSource(bais);
-
-        assertNotNull(exportService);
-        assertNotNull(zipSource.getCreationOrder());
-        Assert.assertFalse(zipSource.hasNext());
+        new ZipSource(bais);
     }
 
     @Test
@@ -306,14 +302,11 @@ public class ExportServiceTest extends 
ExportImportTestBase {
                 AtlasExportResult.OperationStatus.FAIL));
     }
 
-    @Test
+    @Test(expectedExceptions = AtlasBaseException.class)
     public void requestingExportOfNonExistentEntity_ReturnsFailure() throws 
Exception {
         AtlasExportRequest request = getRequestForEmployee();
         tamperEmployeeRequest(request);
-        ZipSource zipSource = runExportWithParameters(request);
-
-        assertNotNull(zipSource.getCreationOrder());
-        assertEquals(zipSource.getCreationOrder().size(), 0);
+        runExportWithParameters(request);
     }
 
     @Test

Reply via email to