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 8c9022a commit a83c3e3
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,15 @@ class OpenAPILocalURLIssueTest {
swagger = OpenApiAccess.getOpenAPIFromURL(urlToTest)
}

// The message in the SutException should be "The file path provided for the OpenAPI Schema
// $urlToTest , is not a valid path"
Assertions.assertTrue(exception.message!!.contains("The file path provided for the OpenAPI Schema " +
"$urlToTest," + " ended up with the following error: "))
// In windows, the file cannot be located, in others the error is URL related
if (hostOs.contains("win")) {
Assertions.assertTrue(exception.message!!.contains("The provided swagger file " +
"does not exist: $urlToTest"))
}
else {
Assertions.assertTrue(exception.message!!.contains("The file path provided for the OpenAPI Schema " +
"$urlToTest," + " ended up with the following error: "))
}
}

@Test
Expand Down

0 comments on commit a83c3e3

Please sign in to comment.