Skip to content

Conversation

@bkkothari2255
Copy link
Contributor

Issue: SLING-13101

Continuing the JUnit 5 migration for the org.apache.sling.models.impl package.
This PR covers 12 test classes starting with the letters P through R.

Changes

  • JUnit 5 Migration:
    • Replaced MockitoJUnitRunner with @ExtendWith(MockitoExtension.class).
    • Updated all imports to org.junit.jupiter.api.
    • Replaced @Test(expected) with assertThrows.
  • Modernization & Cleanup:
    • Replaced deprecated new Integer() with Integer.valueOf().
    • Updated RandomStringUtils.randomAlphabetic(10) to RandomStringUtils.secureStrong().nextAlphabetic(10).
    • Removed redundant throws clauses.
    • Added missing assertion statements where necessary.
  • Strictness Handling:
    • Applied lenient() strictness to shared setup methods to preserve legacy test behavior and prevent UnnecessaryStubbingException without altering the original logic.

@bkkothari2255 bkkothari2255 force-pushed the feature/SLING-13101-migrate-request-resource-junit5 branch from 8e99a75 to 43f14cd Compare February 9, 2026 18:19
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 9, 2026

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant