adityamparikh commented on PR #175:
URL: https://github.com/apache/solr-mcp/pull/175#issuecomment-5357682631
Added an end-to-end test and closed a duplicate PR in this one's favour.
**Duplicate:** I opened #185 against the same bug without spotting this PR —
my duplicate check
searched issues, not pull requests. #185 is now closed, and issue #182
(which I filed for the
same defect) points here.
Comparing the two implementations, **this one is better** and is what should
merge. It anchors on
the full path `facet_counts/facet_fields/<field>`, so a key named
`facet_fields` appearing
anywhere else in a response cannot be misread. #185 matched the bare key at
any depth. #185 also
covered `facet_queries` and `facet_intervals`, but that turned out to be
dead weight — Solr emits
both as JSON objects, which already decode correctly through `convertObject`.
**Ported across (e4d0646):** the one thing #185 had that this PR didn't — an
integration test
against real Solr via Testcontainers.
The existing `JsonResponseParserTest` pins decoding at the parser boundary
with a hand-written
payload, which is the right place for it. But that leaves one assumption
unverified: that a real
Solr genuinely emits `[]` for a zero-hit facet. If Solr ever emitted `{}`
instead, those unit
tests would keep passing while the bug they guard had stopped existing in
that form. The new test
closes that gap by faceting a filter designed to match nothing and asserting
an empty facet map
comes back.
Verified rather than assumed: reverting only the `JsonResponseParser` change
on this branch and
re-running makes the new test fail with `java.lang.ClassCastException`. With
the fix it passes.
Full build is **378 tests, 0 failures, 7 skipped**.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]