diff --git a/src/test/java/blockchains/iaas/uni/stuttgart/de/adaptation/TestLoadAdapter.java b/src/test/java/blockchains/iaas/uni/stuttgart/de/adaptation/TestLoadAdapter.java index ed2b575..c295e13 100644 --- a/src/test/java/blockchains/iaas/uni/stuttgart/de/adaptation/TestLoadAdapter.java +++ b/src/test/java/blockchains/iaas/uni/stuttgart/de/adaptation/TestLoadAdapter.java @@ -114,17 +114,20 @@ public void testLoadConnectionProfile() throws IOException, URISyntaxException { private void clearPluginDirectory() throws IOException { log.info("Cleaning up plugin directory from potential plugin files: {}", () -> pluginManager.getPluginsPath()); Path path = pluginManager.getPluginsPath(); - try(Stream files = Files.list(path)) { - files.forEach(filePath -> { - try { - if (Files.isRegularFile(filePath)) { - log.info("Removing file: {}", filePath); - Files.delete(filePath); + + if (Files.exists(path)) { + try (Stream files = Files.list(path)) { + files.forEach(filePath -> { + try { + if (Files.isRegularFile(filePath)) { + log.info("Removing file: {}", filePath); + Files.delete(filePath); + } + } catch (IOException e) { + throw new RuntimeException(e); } - } catch (IOException e) { - throw new RuntimeException(e); - } - }); + }); + } } }