From 98d19c268ebd6aac55aa86f628972b10a175471e Mon Sep 17 00:00:00 2001 From: Arved Solth Date: Tue, 14 Nov 2023 13:46:47 +0100 Subject: [PATCH] Resolve Codacy code issues --- .../services/file/FileServiceIT.java | 5 +++++ .../org/kitodo/utils/ProcessTestUtils.java | 20 +++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Kitodo/src/test/java/org/kitodo/production/services/file/FileServiceIT.java b/Kitodo/src/test/java/org/kitodo/production/services/file/FileServiceIT.java index 99334bf479f..9fa831efe98 100644 --- a/Kitodo/src/test/java/org/kitodo/production/services/file/FileServiceIT.java +++ b/Kitodo/src/test/java/org/kitodo/production/services/file/FileServiceIT.java @@ -216,6 +216,11 @@ private void cleanUp() throws IOException { TreeDeleter.deltree(firstDirectoryOfTestPath); } + /** + * Cleanup test resources and dummy processes after test completion. + * + * @throws Exception when removing process from database, index or filesystem fails. + */ @AfterClass public static void removeDummyAndTestProcesses() throws Exception { for (int processId : dummyProcessIds) { diff --git a/Kitodo/src/test/java/org/kitodo/utils/ProcessTestUtils.java b/Kitodo/src/test/java/org/kitodo/utils/ProcessTestUtils.java index 5a35a617022..113c65e12a8 100644 --- a/Kitodo/src/test/java/org/kitodo/utils/ProcessTestUtils.java +++ b/Kitodo/src/test/java/org/kitodo/utils/ProcessTestUtils.java @@ -14,6 +14,14 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import java.io.IOException; +import java.net.URI; +import java.nio.file.Paths; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.kitodo.MockDatabase; @@ -27,14 +35,6 @@ import org.kitodo.production.services.ServiceManager; import org.primefaces.model.DefaultTreeNode; -import java.io.IOException; -import java.net.URI; -import java.nio.file.Paths; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.stream.Collectors; - public class ProcessTestUtils { private static final String TEST_IMAGES_DIR = "images"; @@ -117,8 +117,8 @@ public static void copyTestMetadataFile(int processId, String filename) throws I } /** - * Add process with given title "processTitle" and to project with configured ID 'TEST_PROJECT_ID' and template 'TEST_TEMPLATE_ID' - * to mock database + * Add process with given title "processTitle" and to project with configured ID 'TEST_PROJECT_ID' and template + * 'TEST_TEMPLATE_ID' to mock database. * @param processTitle title of process to add * @return created process * @throws DAOException when adding process fails