[Fix #1240] Avoiding duplicate listeners#1241
Merged
fjtirado merged 1 commit intoserverlessworkflow:mainfrom Mar 18, 2026
Merged
[Fix #1240] Avoiding duplicate listeners#1241fjtirado merged 1 commit intoserverlessworkflow:mainfrom
fjtirado merged 1 commit intoserverlessworkflow:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds test coverage for listener management in the WorkflowApplication, specifically testing the sorting by priority and deduplication of listeners. The PR introduces new test listener implementations and modifies WorkflowApplication to wrap the listeners collection in a LinkedHashSet to enable automatic deduplication while preserving insertion order from the priority-based sorting.
Changes:
- Add comprehensive test suite for WorkflowExecutionListener sorting and deduplication behavior
- Introduce test listener implementations with different priority levels to exercise the listener management logic
- Modify WorkflowApplication to use LinkedHashSet for listeners to ensure deduplication while maintaining priority-based order
- Add mockito-core test dependency for test infrastructure
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| WorkflowListenerTest.java | New test class that verifies listener sorting by priority and deduplication of duplicate listeners |
| TopPriorityListener.java | New test listener implementation with higher priority (DEFAULT_PRIORITY - 1) |
| MediumPriorityListener.java | New test listener implementation with standard priority, includes equals/hashCode for deduplication testing |
| LowestPriorityListener.java | New test listener implementation with lower priority (DEFAULT_PRIORITY + 1) |
| WorkflowApplication.java | Wraps listeners collection in LinkedHashSet to enable deduplication while preserving sorted order |
| pom.xml | Adds mockito-core test dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
If a listener implemen equals, it will be honored. Signed-off-by: fjtirado <ftirados@redhat.com>
ricardozanini
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
If a listener implemen equals, it will be honored.
Fix #1240