diff --git a/tcks/microprofile-graphql/src/main/java/io/quarkus/tck/graphql/TestInterceptor.java b/tcks/microprofile-graphql/src/main/java/io/quarkus/tck/graphql/TestInterceptor.java index 3638dabe13f43..170feb48909f6 100644 --- a/tcks/microprofile-graphql/src/main/java/io/quarkus/tck/graphql/TestInterceptor.java +++ b/tcks/microprofile-graphql/src/main/java/io/quarkus/tck/graphql/TestInterceptor.java @@ -60,10 +60,12 @@ public TestInterceptor() { } private void loadSchemaOverride() { + Path folderPath = Paths.get(OVERRIDES); + if (!Files.isDirectory(folderPath)) { + return; + } // Get all csv files - try { - Path folderPath = Paths.get(OVERRIDES); - DirectoryStream overrides = Files.newDirectoryStream(folderPath); + try (DirectoryStream overrides = Files.newDirectoryStream(folderPath)) { List overrideFiles = toListOfPathsForSchema(overrides); List testDataList = toListOfTestDataForSchema( overrideFiles); @@ -78,9 +80,11 @@ private void loadSchemaOverride() { } private void loadExecutionOverride() { - try { - Path folderPath = Paths.get(OVERRIDES); - DirectoryStream overrides = Files.newDirectoryStream(folderPath); + Path folderPath = Paths.get(OVERRIDES); + if (!Files.isDirectory(folderPath)) { + return; + } + try (DirectoryStream overrides = Files.newDirectoryStream(folderPath)) { Set overrideFolders = toListOfPathsForExecution(overrides); executionTestDataMap.putAll(toMapOfTestDataForExecution(overrideFolders)); } catch (IOException ex) {