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
Issue #10932: remove dependency on Powermock from tests #10947
Conversation
e5b6aca
to
380bb4c
Compare
Your PR is huge, please consider to split. |
1aac646
to
da467fa
Compare
Sure. We should start with the hardest case: it is not possible to mock methods in the What should we do?
|
da467fa
to
4a88133
Compare
4a88133
to
35fefd3
Compare
src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/puppycrawl/tools/checkstyle/utils/CommonUtilTest.java
Outdated
Show resolved
Hide resolved
4c50c48
to
c8aee44
Compare
src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java
Outdated
Show resolved
Hide resolved
c8aee44
to
4eb8581
Compare
src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoaderTest.java
Outdated
Show resolved
Hide resolved
4eb8581
to
99c9f0d
Compare
Looking at pitest report, why can't PR be split between the different groupings? treewalker, utils, commons, headers, ... |
Because |
3c6e0cd
to
e287f73
Compare
Does this mean that we can remove entire profile for: Line 1907 in e4cf277
? |
Yes. And JUnit4 dependency too. In the next PR. |
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.
items:
src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/puppycrawl/tools/checkstyle/utils/CommonUtilTest.java
Outdated
Show resolved
Hide resolved
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.
items:
src/main/java/com/puppycrawl/tools/checkstyle/utils/CommonUtil.java
Outdated
Show resolved
Hide resolved
e287f73
to
7e36e2d
Compare
GitHub, rebase |
7e36e2d
to
ae834d1
Compare
ae834d1
to
c3a7cc2
Compare
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.
item:
public void testFormatModuleNameContainsCheckSuffix() { | ||
final AuditEvent mock = mock(AuditEvent.class); | ||
when(mock.getSourceName()).thenReturn("TestModuleCheck"); | ||
when(mock.getSeverityLevel()).thenReturn(SeverityLevel.WARNING); |
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.
why we do mock if we can just create AuditEvent with required values ?
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.
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.
This can be done by adding a class to the test source root.
Let's do this.
Without such comment, it is very very unclear.
Previously we agreed that if we do some reflection based test we explain in comment what is a goal.
I think mocking tests should be commented also. Ideally no mocking tests.
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 see comment over methods, but I would be awesome to avoid mocking if that is simple as you describe.
I am approving PR.
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.
Please review #11056
b1a6359
to
2a98d5c
Compare
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.
Ok to merge.
please see comment above as last polishing before next reviewer
|
2a98d5c
to
abd5b20
Compare
@rnveach please review this PR |
Issue #10932
Closes #6439 and #7368
illegal-access=warn
workaround for JD16