From e235ae38b8897002f2b38cd4734a6f7ce361d03f Mon Sep 17 00:00:00 2001 From: JP Date: Fri, 1 Dec 2023 12:10:28 -0700 Subject: [PATCH] Force creation of output directory (#498) --- .../cqf/tooling/acceleratorkit/BaseContentTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tooling/src/test/java/org/opencds/cqf/tooling/acceleratorkit/BaseContentTest.java b/tooling/src/test/java/org/opencds/cqf/tooling/acceleratorkit/BaseContentTest.java index 064084f1c..0affc771f 100644 --- a/tooling/src/test/java/org/opencds/cqf/tooling/acceleratorkit/BaseContentTest.java +++ b/tooling/src/test/java/org/opencds/cqf/tooling/acceleratorkit/BaseContentTest.java @@ -48,7 +48,13 @@ protected BaseContentTest(Spreadsheet spreadsheet, FhirVersionEnum fhirVersion) @BeforeClass protected void init() throws IOException { - outputPath = Files.createTempDirectory(Path.of(tempPath), "content-test-").toAbsolutePath(); + var p = Path.of(tempPath); + if (!p.toFile().exists() && !p.toAbsolutePath().toFile().exists()) { + Files.createDirectories(p); + } + + var f = Files.createTempDirectory(p, "content-test-"); + outputPath = f.toAbsolutePath(); processor = new Processor(); processor.execute(args()); } @@ -168,8 +174,8 @@ protected Path vocabularyPath() { // Resource helpers protected T resourceAtPath(Class resourceClass, Path resourcePath) { - Objects.requireNonNull(resourcePath, "resourcePath is required"); Objects.requireNonNull(resourceClass, "resourceClass is required"); + Objects.requireNonNull(resourcePath, "resourcePath is required"); var file = resourcePath.toFile(); if (!file.exists()) {