Skip to content

CATROID-1635 Migrate Powermock tests: Mockito Inline (Static/Final Mocking)#5163

Open
hannesweilharter wants to merge 32 commits intoCatrobat:developfrom
hannesweilharter:CATROID-1635
Open

CATROID-1635 Migrate Powermock tests: Mockito Inline (Static/Final Mocking)#5163
hannesweilharter wants to merge 32 commits intoCatrobat:developfrom
hannesweilharter:CATROID-1635

Conversation

@hannesweilharter
Copy link
Copy Markdown
Contributor

@hannesweilharter hannesweilharter commented Mar 12, 2026

Migrate testcases from Powermockito to Mockito, specifically focusing on replacing static/final mocking capabilities with Mockito's inline mocking features.

  • Replaced @RunWith(PowerMockRunner.class with @RunWith(MockitoJUnitRunner.class)
  • Changed from PowerMockito.mockStatic(ClassName.class) to Mockito.mockStatic(ClassName.class)
  • Added MockedStatic<ClassName> field declarations
  • Changed from PowerMockito.whenNew(ClassName.class).withAnyArguments().thenReturn(mock) to Mockito.mockConstruction(ClassName.class)
  • Replaced PowerMockito.doNothing(), PowerMockito.when(), PowerMockito.spy() with standard Mockito equivalents

Additionally:

  • fix BricksXmlSerializerTest
  • adapt ClassDiscoverer

https://catrobat.atlassian.net/browse/CATROID-1635

Your checklist for this pull request

Please review the contributing guidelines and wiki pages of this repository.

  • Include the name of the Jira ticket in the PR’s title
  • Include a summary of the changes plus the relevant context
  • Choose the proper base branch (develop)
  • Confirm that the changes follow the project’s coding guidelines
  • Verify that the changes generate no compiler or linter warnings
  • Perform a self-review of the changes
  • Verify to commit no other files than the intentionally changed ones
  • Include reasonable and readable tests verifying the added or changed behavior
  • Confirm that new and existing unit tests pass locally
  • Check that the commits’ message style matches the project’s guideline
  • Stick to the project’s gitflow workflow
  • Verify that your changes do not have any conflicts with the base branch
  • After the PR, verify that all CI checks have passed
  • Post a message in the catroid-stage or catroid-ide Slack channel and ask for a code reviewer

…ify ClassDiscoverer.getAllSubClassesOf function
@hannesweilharter hannesweilharter self-assigned this Mar 12, 2026
@hannesweilharter hannesweilharter added the Active Member Tickets that are assigned to members that are still currently active label Mar 12, 2026
@sonarqubecloud
Copy link
Copy Markdown

@hannesweilharter hannesweilharter marked this pull request as ready for review March 17, 2026 21:09
@hannesweilharter hannesweilharter removed their assignment Apr 14, 2026
@harshsomankar123-tech
Copy link
Copy Markdown
Member

@hannesweilharter Is this PR ready for review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Active Member Tickets that are assigned to members that are still currently active

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants