-
-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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
Fixed most reported issues by SonarCloud. #1492
Fixed most reported issues by SonarCloud. #1492
Conversation
I've fixed an issue that was causing build failures, which regarded the order of imports within a class, that's been resolved but now there seems to be a new error causing build failures, and I don't think it has something to do directly with any of the code I've modified. I've searched for the file that it's asking for, and it is inside the project directory.
|
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.
Looks to me like it's a white space issue, there was a similiar whitespace issue within either the commander class or the sergeant class which caught my eye while reading to to write test cases for them, seems like I missed this one. I'll fix this right now, and push the changes. |
Issue has been fixed and pushed, I've tested the test case locally, and it has passed. |
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.
The build is still failing. This time it seems to be a Checkstyle issue in Unit of Work pattern.
In that case, I'll just keep building until I don't run into any issues. I'll request a review after those build errors are gone. |
You can detect Checkstyle issues faster using IDE. See instructions here: https://github.com/iluwatar/java-design-patterns/wiki/12.-IDE-instructions |
There is an issue that is also causing build failures but I don't exactly know of a right way to approach this. This issue is being caused by How To Recreate
Known Ways to Resolve Issue
Example
|
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.
Partial Response build fails because you are trying to mix JUnit 4 with JUnit 5. I think the current tests in that module have been written for JUnit 4. So either upgrade everything to 5 or stick with version 4.
You can detect the version from the imports. JUnit 4 imports look like this:
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
Whereas tests written for JUnit 5 have this kind of imports:
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
Unfortunately this was not the case, I've upgraded everything within that module to use JUnit 5, and it was still failing to build. The issue was being caused by an older version of the following dependency`
After changing that specific dependencies version to use version |
Fork Update
# Conflicts: # pom.xml
…es that were causing build failures.
…nto SonarCloud-Reports-Issue#1012
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<version>5.0.0</version> |
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.
Use the one from parent pom.xml
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.
If you would like me to use the version from the parent pom, then the version within the parent pom would have to be updated, as that version is causing build issues within this module.
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.
The other issues have been resolved and I will not push any changes just yet, as I'd like to know if you want to open a new issue regarding updating the classes that rely on the older version of junit-jupiter-engine
.
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.
Acknowledge that. Then it's ok to leave as it is at this point. I'll create a follow-up issue to address the version problems.
@all-contributors please add @ToxicDreamz for code |
I've put up a pull request to add @ToxicDreamz! 🎉 |
Many thanks @ToxicDreamz for looking into this issue. Let's see how the Sonar analysis looks after merging this! |
SonarCloud Issue fixes
Pull request description