Skip to content

Add unit tests for JsonIndexHandler index lifecycle#19045

Open
Akanksha-kedia wants to merge 4 commits into
apache:masterfrom
Akanksha-kedia:feat/json-index-handler-test
Open

Add unit tests for JsonIndexHandler index lifecycle#19045
Akanksha-kedia wants to merge 4 commits into
apache:masterfrom
Akanksha-kedia:feat/json-index-handler-test

Conversation

@Akanksha-kedia

@Akanksha-kedia Akanksha-kedia commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

Adds unit tests for JsonIndexHandler, closing the coverage gap for the JSON index handler.

Test cases covered:

  • Index removal when column is dropped from config (updateIndices verifies removeIndex is called)
  • New index creation when column is added to config (metadata present)
  • No update when column metadata is absent (column not yet in segment)
  • No update when index is already present and matches config

This is part of the same series as:

Test plan

  • JsonIndexHandlerTest passes locally
  • No production code changes — test-only PR

Akanksha-kedia and others added 4 commits July 10, 2026 11:37
JsonIndexHandler had no unit test coverage. Adds JsonIndexHandlerTest
with 5 tests covering:
- Column dropped from config triggers index removal
- updateIndices removes index for dropped column
- New column with metadata present triggers index creation
- Column in config but metadata absent skips index creation
- Index already present and in config requires no update

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…dler preconditions

Stub getTotalDocs()→1 and getAllColumns()→TreeSet in all SegmentMetadataImpl
mocks so the BaseIndexHandler constructor precondition check does not throw.
@Akanksha-kedia

Copy link
Copy Markdown
Contributor Author

cc @Jackie-Jiang @richardstartin — would appreciate a review when you get a chance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant