Skip to content

SLING-13257: Improve Test Coverage - #27

Open
apelluru wants to merge 5 commits into
masterfrom
feature/improve-test-coverage
Open

SLING-13257: Improve Test Coverage#27
apelluru wants to merge 5 commits into
masterfrom
feature/improve-test-coverage

Conversation

@apelluru

@apelluru apelluru commented Jul 6, 2026

Copy link
Copy Markdown
Member

This PR significantly increases the unit-test coverage of the org.apache.sling.auth.core bundle from roughly 43% to 90.79% instruction coverage, without any changes to production code. It adds new test classes and extends existing ones to exercise previously-untested paths across the SPI, impl, and engine-integration packages.

What changed

  • No production/source changes — test-only additions.
  • Extended existing test classes: AuthUtilTest, PathBasedHolderTest, SlingAuthenticatorTest.
  • Added new test classes covering previously-untested components, including:
  • impl: AuthenticationHandlerHolderTest, AuthenticationHandlerWrapperTest, AuthenticationRequirementHolderTest, AuthenticatorWebConsolePluginTest, HttpBasicAuthenticationHandlerTest, LoginServletTest, LogoutServletTest
  • impl/engine: engine-integration wrapper tests
  • spi: AbstractAuthenticationHandlerTest, AbstractAuthenticationFormServletTest, AbstractJakartaAuthenticationFormServletTest, DefaultAuthenticationFeedbackHandlerTest, DefaultJakartaAuthenticationFeedbackHandlerTest
  • Covered both the legacy javax.servlet and Jakarta EE (jakarta.servlet) code paths where parallel variants exist.
  • Exercised key edge cases: redirect validation (isRedirectValid), login-failure handling (handleLoginFailure, including TooManySessionsException and generic-error branches), handleSecurity flows, IOException error paths, and referer/URL validation.

@apelluru
apelluru marked this pull request as ready for review July 7, 2026 07:37
@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

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