Skip to content

Commit

Permalink
Fixed one test case based on the operating system in order to generat…
Browse files Browse the repository at this point in the history
…e the exception "URI path component is empty". Also, attempted to make tests run and pass both in windows and linux by changing the file separator if the OS is Windows.
  • Loading branch information
onurd86 committed Oct 16, 2023
1 parent fef65ce commit 8c9022a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ class OpenAPILocalURLIssueTest {
fun testNonExistingFileInvalidURL() {

// get the current directory
val urlToTest = "file:/$swaggerTestDirectory/openapi_pet_non_existent.json"
val urlToTest = if (hostOs.contains("win")) {
"file://$swaggerTestDirectory/openapi_pet_non_existent.json"
}
else {
"file:/$swaggerTestDirectory/openapi_pet_non_existent.json"
}

// since the file does not exist and URL is invalid, a valid swagger cannot be created
// but an SutException should be thrown
Expand Down

0 comments on commit 8c9022a

Please sign in to comment.