Skip to content

Migrate UniqueTest from Arquillian to AbstractQueryTest#3675

Draft
apmoriarty wants to merge 1 commit into
integrationfrom
task/migrate-unique-test
Draft

Migrate UniqueTest from Arquillian to AbstractQueryTest#3675
apmoriarty wants to merge 1 commit into
integrationfrom
task/migrate-unique-test

Conversation

@apmoriarty

Copy link
Copy Markdown
Collaborator

Drops the Arquillian container deployment and the ShardRange/DocumentRange nested subclasses in favor of extending AbstractQueryTest directly, with the SHARD/DOCUMENT ingest range and each test method's per-case loops converted to @ParameterizedTest + @MethodSource, following the pattern used for QueryFunctionQueryTest/FunctionalSetTest. Ingestion for both ranges happens once in @BeforeAll.

This test's assertion shape doesn't fit AbstractQueryTest's default Document/UUID model at all - it needs DocumentTransformer-produced EventBase objects grouped into "unique" sets, matched against sets of acceptable internal IDs. executeQuery() is overridden to build that event list directly (using logic.getConfig().getQuery(), which holds the same settings object passed to initialize()) instead of relying on the base class's Document deserialization, and extraAssertions() replicates the original set-matching logic, using a local copy of expectedGroups per the same destructive-iteration gotcha already found in ExcerptTest/SummaryTest.

Also fixes a stale expected-grouping in testUniquenessWithHitTermField: the three WiseGuys UIDs were expected to collapse into a single unique result, but HIT_TERM legitimately differs per event (the matched term text includes the UUID value itself), so they should not collapse the way the sibling BOTH_NULL-based tests do. Confirmed via a temporary debug print showing all three IDs correctly returned as three distinct events before correcting the expectation to three separate singleton groups.

Drops the Arquillian container deployment and the ShardRange/DocumentRange
nested subclasses in favor of extending AbstractQueryTest directly, with
the SHARD/DOCUMENT ingest range and each test method's per-case loops
converted to @ParameterizedTest + @MethodSource, following the pattern
used for QueryFunctionQueryTest/FunctionalSetTest. Ingestion for both
ranges happens once in @BeforeAll.

This test's assertion shape doesn't fit AbstractQueryTest's default
Document/UUID model at all - it needs DocumentTransformer-produced
EventBase objects grouped into "unique" sets, matched against sets of
acceptable internal IDs. executeQuery() is overridden to build that event
list directly (using logic.getConfig().getQuery(), which holds the same
settings object passed to initialize()) instead of relying on the base
class's Document deserialization, and extraAssertions() replicates the
original set-matching logic, using a local copy of expectedGroups per the
same destructive-iteration gotcha already found in ExcerptTest/SummaryTest.

Also fixes a stale expected-grouping in testUniquenessWithHitTermField:
the three WiseGuys UIDs were expected to collapse into a single unique
result, but HIT_TERM legitimately differs per event (the matched term text
includes the UUID value itself), so they should not collapse the way the
sibling BOTH_NULL-based tests do. Confirmed via a temporary debug print
showing all three IDs correctly returned as three distinct events before
correcting the expectation to three separate singleton groups.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@apmoriarty apmoriarty marked this pull request as draft July 10, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant