Skip to content

Improve JaCoCo coverage with targeted branch/exception-path tests#630

Merged
hazendaz merged 1 commit into
masterfrom
copilot/improve-test-coverage
May 24, 2026
Merged

Improve JaCoCo coverage with targeted branch/exception-path tests#630
hazendaz merged 1 commit into
masterfrom
copilot/improve-test-coverage

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 24, 2026

Current coverage was ~93% and several defensive/error branches in CDI internals were untested, which limited confidence in extension and proxy behavior reported to JaCoCo/Coveralls. This PR adds focused unit tests to close those gaps without changing production code.

  • Coverage gap closure in CDI/MyBatis internals

    • Added CoverageImprovementTest to exercise previously missed branches in:
      • MybatisExtension (invalid producer type, unannotated SqlSessionFactory producer, non-@Mapper path, BeanKey compare/equality/hash paths)
      • CDIUtils (missing SqlSessionFactory resolution failure path)
      • SqlSessionManagerRegistry (unsatisfied factory path)
      • MyBatisBean (default qualifier injection path)
      • SerializableMapperProxy (invocation exception unwrapping)
      • MybatisCdiConfigurationException (message propagation)
  • No runtime behavior changes

    • Scope is strictly test additions; library/runtime code remains unchanged.
  • Coverage outcome

    • JaCoCo overall moved from ~93% to 97.57% instruction / 98.36% line coverage, improving what Coveralls tracks.
Throwable thrown = assertThrows(IllegalStateException.class, () -> proxy.invoke(null, method, null));
assertEquals("boom", thrown.getMessage());

@hazendaz hazendaz marked this pull request as ready for review May 24, 2026 17:47
@coveralls
Copy link
Copy Markdown

coveralls commented May 24, 2026

Coverage Status

coverage: 98.361% (+5.3%) from 93.033% — copilot/improve-test-coverage into master

@hazendaz hazendaz merged commit ebefc79 into master May 24, 2026
24 checks passed
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.

3 participants