Skip to content

Commit 594a3df

Browse files
klauermtimtebeeksambsnydD067517
authored
Improvement of Replace PowerMockito with Mockito static mocking (#312)
* Unit Test for replacing mockStatic method. * Modified recipe list * Tried to use org.powermock for unit test * Update src/test/java/org/openrewrite/java/testing/mockito/ReplacePowerMockitoIntegrationTest.java Co-authored-by: Tim te Beek <[email protected]> * Update src/test/java/org/openrewrite/java/testing/mockito/ReplacePowerMockitoIntegrationTest.java * added unit test parser dependency to powermock * Add powermock jars for classpathFromResources * Removed additional Powermock annotations * Exclude Visual Studio Code settings from git * New Recipe PowerMockitoMockStaticToMockito - First it removes the PowerMockTestCaseConfig extension * Try to replace @PrepareForTest annotation with new MockedStatic fields * Give the test method a meaningful name * Mostly get the test cases passing. There is still a problem with the template which I think is a bug in OpenRewrite. * Get tests passing * Add missing license headers * Updated mockito.yml and IntegrationTest to reflect changes from last commit of code review * Added tearDown() methods to the refactored tests * Refactoring and code clean up * Fixed issue with missing statements in tearDown method. - Unit tests are failing because of missing type * Tried to replace Mockito.when with MockedStatic.when - Unit tests are failing because of missing type * Specified requirements in ReplacePowerMockitoIntegrationTest - Unit tests are failing because of missing type * Fixed unit tests and 1 integration test - The testNG case is still missing - Unit tests are failing because of missing type * First version of recipe to work with TestNG * Refactor test framework information holder and fix unit test issues * Enable ReplacePowerMockitoIntegrationTest and add testng-7.7.1 to classpathFromResources * Fix annotation pattern in yml file --------- Co-authored-by: Tim te Beek <[email protected]> Co-authored-by: Sam Snyder <[email protected]> Co-authored-by: Tim te Beek <[email protected]> Co-authored-by: D067517 <[email protected]>
1 parent bfa9228 commit 594a3df

File tree

5 files changed

+720
-205
lines changed

5 files changed

+720
-205
lines changed

0 commit comments

Comments
 (0)