Extract validation logic from DataDictionary into DataDictionaryValidator - #1306
Open
konradbloor wants to merge 3 commits into
Open
Extract validation logic from DataDictionary into DataDictionaryValidator#1306konradbloor wants to merge 3 commits into
DataDictionary into DataDictionaryValidator#1306konradbloor wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1306 +/- ##
============================================
+ Coverage 70.42% 70.93% +0.50%
- Complexity 2249 2281 +32
============================================
Files 159 160 +1
Lines 9065 9072 +7
Branches 1192 1192
============================================
+ Hits 6384 6435 +51
+ Misses 2218 2190 -28
+ Partials 463 447 -16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
konradbloor
force-pushed
the
feature/extract-datadictionary-validator
branch
from
August 19, 2026 14:07
a22b45b to
24dc7ae
Compare
…lidator` `DataDictionaryValidator` holds the `ValidationSettings` as instance state, so the validation methods no longer need to pass settings (or individual flags) as parameters. The public `DataDictionary.validate()` overloads are kept and delegate to the new class, so no API change for callers. Method bodies are moved verbatim apart from referencing the dictionary and settings through `dd.` and `settings.`.
…DictionaryValidator` at call sites
konradbloor
force-pushed
the
feature/extract-datadictionary-validator
branch
from
August 19, 2026 14:11
24dc7ae to
d770386
Compare
…lidation tests JaCoCo attributes a call site as missed when the called method throws, so the `throwNewFieldException` helper made `checkGroupCount` appear uncovered even though tests exercised it. Inline the throws and add tests for the matching, mismatched, non-integer, and undefined-group cases.
chrjohn
reviewed
Aug 19, 2026
| public void validate(Message message, ValidationSettings settings) throws IncorrectTagValue, FieldNotFound, | ||
| IncorrectDataFormat { | ||
| validate(message, false, settings); | ||
| new DataDictionaryValidator(settings).validate(this, message); |
Member
There was a problem hiding this comment.
Currently OOO so cannot browse all changes in full, but this looks like we create a new object on every call to validate()?
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.
This is a follow-up to #1303 — there I said I would make the validation methods consistent. The review feedback on that PR was to pass a single flag rather than the whole
ValidationSettingswhen a method only reads one attribute. This PR actually pulls the validation out into its own class which also holds the settings.Looking at
DataDictionary, it does three things: loading the XML dictionary, providing a queryable message metadata model, and validation. Ideally a change to how we validate shouldn't mean modifyingDataDictionary, so this PR moves the validation logic (~240 lines:validate,iterateand thecheck*methods) into a newDataDictionaryValidatorclass. The existing public API is unaffected — theDataDictionary.validate(...)overloads are kept and delegate to the new class.A couple of notes:
DataDictionaryValidatorpackage-private if we should keep it internal, what do you think?