Skip to content

Commit 8916987

Browse files
authored
Fix test on Windows (#19980)
* comment out broken tests * fixed test for windows
1 parent 32fdd7c commit 8916987

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,14 +740,22 @@ public Boolean call() throws Exception {
740740
Future<Boolean> call2 = executor.submit(new Callable<Boolean>() {
741741
@Override
742742
public Boolean call() throws Exception {
743-
return codegen.executePostProcessor(new String[] { "echo Hello" });
743+
String os = System.getProperty("os.name");
744+
String postProcessor = os.contains("Windows")
745+
? "cmd.exe /c echo hello"
746+
: "echo Hello";
747+
return codegen.executePostProcessor(new String[] { postProcessor });
744748
}
745749
});
746750

747751
Future<Boolean> call3 = executor.submit(new Callable<Boolean>() {
748752
@Override
749753
public Boolean call() throws Exception {
750-
return codegen.executePostProcessor(new String[] { "echo", "Hello" });
754+
String os = System.getProperty("os.name");
755+
String[] postProcessor = os.contains("Windows")
756+
? new String[] { "cmd.exe", "/c", "echo", "hello" }
757+
: new String[] { "echo", "Hello" };
758+
return codegen.executePostProcessor(postProcessor);
751759
}
752760
});
753761

0 commit comments

Comments
 (0)