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 {
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
......
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