Skip to content

Commit 0257fbf

Browse files
authored
getResource puts a leading slash before the disk name on Windows (#268)
1 parent aedba95 commit 0257fbf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

deployment/src/test/java/io/quarkiverse/openapi/generator/deployment/template/QuteTemplatingEngineAdapterTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ public class QuteTemplatingEngineAdapterTest {
1919
@Test
2020
void checkTemplateGenerator() throws IOException {
2121
final String petstoreOpenApi = requireNonNull(this.getClass().getResource("/openapi/petstore-openapi.json")).getPath();
22+
// getResource puts a leading slash before the disk name on Windows, thus we wrap it into a file object
23+
final File petstoreOpenApiFile = new File(petstoreOpenApi);
2224
final DefaultGenerator generator = new DefaultGenerator();
2325
final CodegenConfigurator configurator = new QuarkusCodegenConfigurator();
24-
final File apiFile = File.createTempFile("api", "java");
26+
final File apiFile = File.createTempFile("api", ".java");
2527
apiFile.deleteOnExit();
26-
configurator.setInputSpec(petstoreOpenApi);
28+
configurator.setInputSpec(petstoreOpenApiFile.getAbsolutePath());
2729
generator.opts(configurator.toClientOptInput());
2830

2931
final File writtenFile = generator.getTemplateProcessor().write(Collections.singletonMap("name", "Jack"), "hello.qute",

0 commit comments

Comments
 (0)