From 9ce62cdd9a712c1a1a214ca7317409002037bacf Mon Sep 17 00:00:00 2001 From: Falko Modler Date: Sat, 22 Jan 2022 19:33:52 +0100 Subject: [PATCH] Fix noise about missing `src/main/resources/overrides` in GraphQL TCK module --- .../io/quarkus/tck/graphql/TestInterceptor.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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) {