Add comprehensive tests for ExecutionListenerAdapter #5162
+150
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Resolves the TODO comment in
ExecutionListenerAdapterTestsby implementing tests for all adapter methods that were previously untested. This significantly improves test coverage of theExecutionListenerAdapterclass.Motivation
The test file had a TODO comment:
// TODO Test other adapter methods.Only 1 out of 6 methods was tested (
reportingEntryPublished), leaving 83% of the adapter's functionality untested.Changes
Added comprehensive tests for all previously untested methods:
testDynamicTestRegistered()- Verifies dynamic test registration handlingtestExecutionStarted()- Verifies test execution start notificationstestExecutionSkipped()- Verifies test skip notifications with reasonstestExecutionFinished()- Verifies test execution completion handlingtestFileEntryPublished()- Verifies file entry publicationImplementation Details
MockTestExecutionListenerto capture all callback invocationstestReportingEntryPublishedTestDescriptortoTestIdentifierTestPlanis correctly consulted for identifier lookupTesting
All new tests pass and follow the established patterns in the codebase.
Resolves TODO at line 33 in
ExecutionListenerAdapterTests.java