Commit 7ffbec1a by Ashutosh Mestry

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

parent 016eaffa
...@@ -218,7 +218,7 @@ public class ExportServiceTest extends ExportImportTestBase { ...@@ -218,7 +218,7 @@ public class ExportServiceTest extends ExportImportTestBase {
assertNotNull(result.getSourceClusterName()); assertNotNull(result.getSourceClusterName());
} }
@Test @Test(expectedExceptions = AtlasBaseException.class)
public void requestingEntityNotFound_NoData() throws AtlasBaseException, IOException { public void requestingEntityNotFound_NoData() throws AtlasBaseException, IOException {
String requestingIP = "1.0.0.0"; String requestingIP = "1.0.0.0";
String hostName = "root"; String hostName = "root";
...@@ -231,11 +231,7 @@ public class ExportServiceTest extends ExportImportTestBase { ...@@ -231,11 +231,7 @@ public class ExportServiceTest extends ExportImportTestBase {
Assert.assertNull(result.getData()); Assert.assertNull(result.getData());
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
ZipSource zipSource = new ZipSource(bais); new ZipSource(bais);
assertNotNull(exportService);
assertNotNull(zipSource.getCreationOrder());
Assert.assertFalse(zipSource.hasNext());
} }
@Test @Test
...@@ -306,14 +302,11 @@ public class ExportServiceTest extends ExportImportTestBase { ...@@ -306,14 +302,11 @@ public class ExportServiceTest extends ExportImportTestBase {
AtlasExportResult.OperationStatus.FAIL)); AtlasExportResult.OperationStatus.FAIL));
} }
@Test @Test(expectedExceptions = AtlasBaseException.class)
public void requestingExportOfNonExistentEntity_ReturnsFailure() throws Exception { public void requestingExportOfNonExistentEntity_ReturnsFailure() throws Exception {
AtlasExportRequest request = getRequestForEmployee(); AtlasExportRequest request = getRequestForEmployee();
tamperEmployeeRequest(request); tamperEmployeeRequest(request);
ZipSource zipSource = runExportWithParameters(request); runExportWithParameters(request);
assertNotNull(zipSource.getCreationOrder());
assertEquals(zipSource.getCreationOrder().size(), 0);
} }
@Test @Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment