openrewrite / openrewrite/rewrite-testing-frameworks

PowerMock MemberModifier support

Open
#784 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement mockito recipe
Dominant language
Java
Stars
100
Forks
105
Avg merge
2h 25m
Merged PRs (30d)
9

Description

What problem are you trying to solve?

MemberModifier method cannot be recognized and implemented in mockito.

Describe the solution you'd like

https://docs.openrewrite.org/recipes/java/testing/mockito/replacepowermockito
MemberModifier.field(WebLicenseManager.class, "coreLics").set(webLicenseManager, coreLics);

Have you considered any alternatives or workarounds?

Private method → package-level visibility + @VisibleForTesting

Additional context

Are you interested in contributing this feature to OpenRewrite?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ReplacePowerMockito recipe at the linked documentation path and inspect how it handles Mockito migrations. Trace the MemberModifier.field(WebLicenseManager.class, "coreLics").set(...) example and determine the expected converted form. Done means this MemberModifier usage is recognized and transformed consistently, with coverage added for the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.