/** * Cleans up the destination S3 key prefixes used by the uploader unit tests. */ protected void cleanupS3() { // Delete the test business object data versions. S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto = getTestS3FileTransferRequestParamsDto(); for (String s3KeyPrefix : new String[] {S3_TEST_PARENT_PATH_V0, S3_TEST_PARENT_PATH_V1, S3_TEST_PATH_V0, S3_TEST_PATH_V1, S3_SIMPLE_TEST_PATH}) { s3FileTransferRequestParamsDto.setS3KeyPrefix(s3KeyPrefix); if (!s3Service.listDirectory(s3FileTransferRequestParamsDto).isEmpty()) { s3Service.deleteDirectory(s3FileTransferRequestParamsDto); } } }
/** * TODO: We need the herd web service mocking done and this test case rewritten, so it would fail right at the end of performUpload() method (on the * business object data registration step) and triggered the rollbackUpload() to occur. */ @Test(expected = RuntimeException.class) public void testPerformUploadRegistrationError() throws Exception { // Upload and register business object data parents. uploadAndRegisterTestDataParents(uploaderWebClient); runUpload(UploaderController.MIN_THREADS); // Clean up the local directory. FileUtils.deleteDirectory(LOCAL_TEMP_PATH_INPUT.toFile()); // Clean up the destination S3 folder. S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto = getTestS3FileTransferRequestParamsDto(S3_TEST_PATH_V0); if (!s3Service.listDirectory(s3FileTransferRequestParamsDto).isEmpty()) { s3Service.deleteDirectory(s3FileTransferRequestParamsDto); } runUpload(UploaderController.MIN_THREADS); }
s3Service.deleteDirectory(params); s3Service.deleteDirectory(params);
s3Service.deleteDirectory(params); s3Service.deleteDirectory(params);