Add unit tests for SequenceReset message handling in Session class#1133
Draft
Add unit tests for SequenceReset message handling in Session class#1133
Conversation
Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add unit tests for SequenceReset message handling in Session class
Add unit tests for SequenceReset message handling in Session class
Feb 6, 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.
SequenceReset message handling in the Session class lacked comprehensive unit test coverage, particularly for GapFill functionality and error conditions.
Changes
New test class:
SessionSequenceResetTest.javawith three test scenarios:Test implementation: Uses Mockito for dependency mocking (MessageStore, Application, Responder), establishes proper logged-on sessions before testing sequence scenarios, and validates message store interactions
Example test flow:
Tests follow existing QuickFIX/J patterns using SessionFactoryTestSupport.Builder for session creation and FIX 4.4 message format.
Original prompt
Problem Statement
Add comprehensive unit tests for SequenceReset message handling in the Session class to ensure proper behavior when receiving SequenceReset messages with and without GapFill flags.
Background
The Session class in QuickFIX/J handles SequenceReset messages which are critical for maintaining sequence number synchronization between FIX counterparties. Currently, there is insufficient test coverage for these scenarios, particularly for the GapFill functionality.
Requirements
Create a new test class
SessionSequenceResetTest.javain the test directory that covers the following scenarios:Test 1: SequenceReset with GapFill
This test should verify the complete flow when a session receives messages out of sequence and uses SequenceReset with GapFill to skip a range of messages:
Test 2: SequenceReset without GapFill (Hard Reset)
Test that a SequenceReset without GapFill flag properly resets the sequence number:
Test 3: Invalid SequenceReset
Test that invalid SequenceReset messages are properly rejected:
Test Implementation Details
The test should:
File Location
Create the test file at:
Dependencies
The test should use existing test dependencies:
Expected Outcome
After implementing these tests:
Test Code