Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ private ParseResult parseOpenAPI() throws MojoExecutionException {
}

static URL specResource(String openApiSpec) {
var res = URI.create(openApiSpec);
try {
var res = URI.create(openApiSpec);
return res.toURL();
} catch (Exception ex) {
var pathUri = Optional.ofNullable(openApiSpec)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.axonivy.ivy.tool.openapi.codegen.mojo;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import java.net.URI;
import java.nio.file.Files;
Expand Down Expand Up @@ -83,4 +84,10 @@ void openApiSpec_asPath() throws Exception {
.isEqualTo(uri);
}

@Test
void openApiSpec_asUri_windows() throws Exception {
String winUri = "C:\\Users\\ReguelWermelingerAxo\\dev\\demo-projects\\connectivity\\connectivity-demos/src/io/swagger/petstore3/client/openapi.json";
assertThatThrownBy(() -> OpenApiClientGeneratorMojo.specResource(winUri));
}

}
Loading