Repository navigation
Conversation
Contributor
📋 Unreleased Changelog Preview
ChangelogAll notable changes to this project will be documented in this file. [Unreleased]✨ Features
Generated by git-cliff 🔄 Run #149 · Thu, 01 Oct 2026 17:22:35 GMT |
Contributor
✅ Test Results
✅ Coverage
🔄 CI run #168 · Thu, 01 Oct 2026 17:26:43 GMT |
* fix: fixed an issue where a NullPointerException was thrown on unset environment variables * fix: close URLClassLoader in PluginRegistry to prevent file handle leak * fix: add missing schemas directory default to reference.conf * fix: harden XML parsers against XXE attacks in XMLUtils * fix: enforce error taxonomy and add missing exception constructors * fix: correct over-suppression of CHILD_NODELIST_LENGTH in XMLUtils * fix: fixed an issue where a SchemaRegistryClient was instantiated at each call instead of being cached * chore: fixed some tests * (feat/bug-fixes) style: spotless * fix: improve byte buffer handling in AvroDeserializer * fix: include cause in ConsumerException for better error handling * fix: handle null values in record matchers and improve logging * fix: enhance security in SAXParserFactory and improve documentation * style: update comments for consistency in punctuation * test: add ClasspathTestPlugin for lifecycle call assertions * refactor: enhance plugin loading and shutdown logic * fix: improve handling of empty records in AttributeRecordMatcher * feat: add AvroJson and AvroLogicalTypesSerializationTest for JSON conversion of Avro logical types * feat: enhance DynamicVariableFactory for thread-safety and case-insensitivity * fix: improve getLine method to handle null content and out-of-bounds indices * refactor: enhance timeout handling and improve documentation in KafkaRecordFetcher * feat: added two new MatchResult noRecords and nullValue * style: improve comments * test: add TombstoneMatcherTest to verify tombstone handling across matchers * refactor: extract null value message to constant in MatchResult * style: spotless * fix: null pointer exception on empty TimestampVariable when format is null * ci: update CI workflow to use reusable Maven CI and add manual integration test option * (feat/bug-fixes) style: spotless * ci: fix workflow paths in CI and dependency review configurations * fix: update dependency review workflow path * style: spotless * test: rename integration tests with *ITTests * test: rename integration tests with *ITTests * ci: enable integration tests by default in CI workflow * deps: bump ktestify-parent version from 1.0.4 to 1.0.5 * feat: introduce FetchTimeoutException for clearer timeout handling * style: spotless # Conflicts: # src/main/java/io/github/ktestify/match/impl/AvroFileKeyRecordMatcher.java # src/main/java/io/github/ktestify/match/impl/AvroKeyRecordMatcher.java # src/main/java/io/github/ktestify/match/impl/FileKeyRecordMatcher.java # src/main/java/io/github/ktestify/match/impl/KeyRecordMatcher.java
This reverts commit 6d44158.
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.
📝 Description
This PR introduces a configurable
KeyMatchStrategyenum inktestify-corethat allowsexpectedRecordKeyto be matched using strategies other than exact equality:CONTAINS,STARTS_WITH,ENDS_WITH, andREGEX.Previously,
expectedRecordKeywas hardcoded toString.equals()in five locations: the fetch-time pre-filter (KafkaRecordFetcher.passesKeyFilter()) and four assertion-time matchers (KeyRecordMatcher,FileKeyRecordMatcher,AvroKeyRecordMatcher,AvroFileKeyRecordMatcher). This made it impossible to validate dynamically generated keys (UUIDs, prefixed keys, etc.) without knowing the exact value upfront.The new
KeyMatchStrategyenum encapsulates the comparison logic in a singlematches(expected, actual)method. It flows through both layers identically to howexpectedRecordKeyalready flows:ConsumerContext(fetch-time filter) andMatchContext(assertion). The default isEXACT, preserving full backward compatibility.Resolves #46
🔄 Type of Change
✅ Pre-Merge Checklist
Code Quality
mvn spotless:check)Tests
mvn verify)Licensing
🧪 How to Test Locally
📸 Screenshots / Logs
All tests pass:
📚 Additional Context
Files Changed
New file:
match/KeyMatchStrategy.java: Enum withEXACT,CONTAINS,STARTS_WITH,ENDS_WITH,REGEX. IncludesfromString()for parsing DataTable values (case-insensitive, tolerant of hyphens/underscores/spaces, defaults toEXACT).Modified (main):
io/kafka/ConsumerContext.javakeyMatchStrategyfield + builder method (defaults toEXACT)io/kafka/KafkaRecordFetcher.javapassesKeyFilter()usesstrategy.matches()instead ofequals()io/kafka/AbstractKafkaConsumer.javabuildMatchContext()propagateskeyMatchStrategytoMatchContextmatch/MatchContext.javakeyMatchStrategyfield with@Builder.Default=EXACTmatch/impl/KeyRecordMatcher.javastrategy.matches()match/impl/FileKeyRecordMatcher.javastrategy.matches()match/impl/AvroKeyRecordMatcher.javastrategy.matches()match/impl/AvroFileKeyRecordMatcher.javastrategy.matches()Modified (test):
match/KeyMatchStrategyTest.javafromString()parsingmatch/impl/KeyRecordMatcherTest.javaKeyStrategiesnested class with 10 strategy testsmatch/impl/MatcherTestSupport.javactxWithKeyAndStrategy()helperBackward Compatibility
The default strategy is
EXACTeverywhere. Existing feature files and code paths that do not setkeyMatchStrategybehave exactly as before. No breaking changes.