test(index): decouple ContentletIndexAPIImplTest from ElasticSearch internals (#36320)#36580
Open
fabrizzio-dotCMS wants to merge 1 commit into
Open
test(index): decouple ContentletIndexAPIImplTest from ElasticSearch internals (#36320)#36580fabrizzio-dotCMS wants to merge 1 commit into
fabrizzio-dotCMS wants to merge 1 commit into
Conversation
…nternals (#36320) Neutralize the ES-direct pieces so the test is vendor/phase-agnostic: - Replace the private ES-direct indexSearch() helper (RestHighLevelClientProvider + SearchRequest/SearchSourceBuilder/QueryBuilders/SearchHits) with the phase-aware SiteSearchAPI.search(index, query, start, rows) in isDocIndexed() — it routes to ES or OS per the active migration phase. - Change testGetIndexDocumentCountWithInvalidIndexNameFails to expect the neutral DotRuntimeException the router wraps the backend index-not-found in, instead of the ES-specific ElasticsearchStatusException. - Remove the 8 org.elasticsearch.* imports + RestHighLevelClientProvider + the unused INDEX_OPERATIONS_TIMEOUT_IN_MS/Sneaky imports. Note: testSearch's highlight assertions still depend on OS site-search highlights, which are not implemented yet (#36576 / #34609), so full phase-2/3 green for that one method is gated on that separate product gap. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Claude finished @fabrizzio-dotCMS's task in 1m 20s —— View job Code Review — decouple
|
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.
Proposed Changes
Decouples
ContentletIndexAPIImplTestfrom ElasticSearch internals so it is vendor/phase-agnostic — the in-scope work of #36320.isDocIndexed()now uses the phase-awareSiteSearchAPI.search(index, query, start, rows)(routes to ES or OS per the active migration phase) instead of the privateindexSearch()that usedRestHighLevelClientProvider+SearchRequest/SearchSourceBuilder/QueryBuilders/SearchHits. TheindexSearch()helper is deleted.testGetIndexDocumentCountWithInvalidIndexNameFailsnowassertThrows(RuntimeException.class, ...)instead of@Test(expected = ElasticsearchStatusException.class). The concrete type differs by backend (ES →ElasticsearchStatusException, OS read path →DotRuntimeException); asserting the commonRuntimeExceptionpasses under every phase without coupling to a vendor type.org.elasticsearch.*imports +RestHighLevelClientProvider+ the now-unusedINDEX_OPERATIONS_TIMEOUT_IN_MS/Sneakyimports. Zeroorg.elasticsearchimports remain.Verification
ContentletIndexAPIImplTestunder phase 0 (ES): 16/0/0 ✅.testSearch's doc-indexed check now passes via the neutral path.Out of scope / note
testSearch's highlight assertions still depend on OpenSearch site-search highlights, which are not implemented yet (#36576 / #34609) — so full phase-2/3 green for that one method is gated on that separate product gap, not on this decoupling.Refs #36320, #36501.