-
Notifications
You must be signed in to change notification settings - Fork 542
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
chore(jkube-kit-common): Removed org.mockito.Mockito references from JKubeProjectUtilTest #2709
Conversation
…JKubeProjectUtilTest
Eclipse JKube CI ReportStarted new GH workflow run for #2709 (2024-02-29T11:59:19Z) ⚙️ JKube E2E Tests (8095446951)
|
void setUp() throws IOException { | ||
project = JavaProject.builder().build(); | ||
artifactFile = new File(temporaryFolder, "foo-test-1.0.0.jar"); | ||
artifactFileCreated = artifactFile.createNewFile(); |
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.
Could you please use Files.createFile(temporaryFolder.toPath().resolve("foo-test-1.0.0.jar"))
here instead? It would automatically throw FileAlreadyExistsException when file already exists (you won't need to check for return value like you're doing here)
|
||
private File artifactFile; | ||
|
||
private boolean artifactFileCreated; |
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 this field won't be required once you replace createNewFile()
with Files.createFile
. This field name is also colliding with local variable names used in some tests
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2709 +/- ##
=============================================
+ Coverage 59.36% 70.48% +11.12%
- Complexity 4586 4998 +412
=============================================
Files 500 486 -14
Lines 21211 19458 -1753
Branches 2830 2504 -326
=============================================
+ Hits 12591 13715 +1124
+ Misses 7370 4518 -2852
+ Partials 1250 1225 -25 ☔ View full report in Codecov by Sentry. |
.buildDirectory(temporaryFolder) | ||
.build(); | ||
File buildFinalArtifactFile = new File(temporaryFolder, "foo-test-final.jar"); | ||
boolean artifactFileCreated = buildFinalArtifactFile.createNewFile(); |
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.
…JKubeProjectUtilTest
|
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.
LGTM, thx!
Description
Fixes #2685
JKubeProjectUtilTest seems to be using mock at some places, which can be refactor to use real objects.
Type of change
test, version modification, documentation, etc.)
Checklist