From 891698784d08d1648999fa2b129d23b8792084f5 Mon Sep 17 00:00:00 2001 From: devhl-labs Date: Mon, 28 Oct 2024 12:35:55 -0400 Subject: [PATCH] Fix test on Windows (#19980) * comment out broken tests * fixed test for windows --- .../org/openapitools/codegen/DefaultCodegenTest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 79a90cad2ee0..3eef324a7bdb 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -740,14 +740,22 @@ public Boolean call() throws Exception { Future call2 = executor.submit(new Callable() { @Override public Boolean call() throws Exception { - return codegen.executePostProcessor(new String[] { "echo Hello" }); + String os = System.getProperty("os.name"); + String postProcessor = os.contains("Windows") + ? "cmd.exe /c echo hello" + : "echo Hello"; + return codegen.executePostProcessor(new String[] { postProcessor }); } }); Future call3 = executor.submit(new Callable() { @Override public Boolean call() throws Exception { - return codegen.executePostProcessor(new String[] { "echo", "Hello" }); + String os = System.getProperty("os.name"); + String[] postProcessor = os.contains("Windows") + ? new String[] { "cmd.exe", "/c", "echo", "hello" } + : new String[] { "echo", "Hello" }; + return codegen.executePostProcessor(postProcessor); } });