-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(catalog-generator): Fix Windows tests #1572
Conversation
d0313d6
to
1abc733
Compare
@@ -84,7 +86,9 @@ void testGeneratorCalledWithCorrectParameters() { | |||
File expectedFolder = new File(tempDir, "camel-main/4.8.0"); | |||
verify(builder, times(1)).withOutputDirectory(expectedFolder); | |||
|
|||
assertEquals(catalogDefinition.getFileName(), "camel-main/4.8.0/index.json"); | |||
String expectedFile = Stream.of("camel-main", "4.8.0", "index.json").reduce((a, b) -> a + File.separator + b).get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better way to do this? A more Java way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it is more common to write it this way (at least for old timers):
"camel"+File.separator+"4.8.0"+File.separator+"index.json"
With more recent features of Java, I would look to something like: Paths.get("camel", "4.8.0", "index.json").toString()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems Path.get()
doesn't exist but Path.of()
worked 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is Paths
with plural
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Path.of() can do the trick too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, plural 🤦♂️
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1572 +/- ##
=======================================
Coverage ? 80.00%
Complexity ? 272
=======================================
Files ? 276
Lines ? 7838
Branches ? 1535
=======================================
Hits ? 6271
Misses ? 1458
Partials ? 109 ☔ View full report in Codecov by Sentry. |
1abc733
to
8598e34
Compare
Quality Gate passedIssues Measures |
Context
Currently, the
catalog-generator
tests are failing in Microsoft Windows due to the file separator.This PR fixes it by using the underlying OS file separator instead.