Description
ContentFactoryIndexOperationsOS is the OS delegate inside ESContentFactoryImpl:
```java
private final ContentFactoryIndexOperations indexOperationsES;
private final ContentFactoryIndexOperations indexOperationsOS; // ← no coverage
```
The ES counterpart (ContentFactoryIndexOperationsES) has coverage through the existing ESContentFactoryImplTest. The OS implementation has zero integration test coverage.
A parallel test class — ContentFactoryIndexOperationsOSIntegrationTest — must be created following the same structure as the already-existing ContentletIndexOperationsOSIntegrationTest (which covers ContentletIndexOperationsOS against a live OS 3.x container).
Acceptance Criteria
- A new integration test class
ContentFactoryIndexOperationsOSIntegrationTest is created under dotcms-integration/.../content/index/opensearch/.
- The class is registered in
OpenSearchUpgradeSuite (only suite with a live OS 3.x instance).
- All public methods of
ContentFactoryIndexOperations that are implemented by the OS delegate are covered:
createBulkRequest() — returns a non-null, empty request
addIndexOp() / addDeleteOp() — increase bulk request size
putToIndex() — document is visible after refresh; empty batch is a no-op
createBulkProcessor() — returns non-null processor; flush on close persists the document
addIndexOpToProcessor() / addDeleteOpToProcessor() — document appears / disappears after flush
getIndexDocumentCount() — returns 0 for an empty index, correct count after writes
- Prerequisite validation (spike): confirm that
OpenSearchUpgradeSuite is the only suite that provides a live OS instance, or identify an alternative suite where these tests could also run. Document findings in the PR description.
- Tests use a
RUN_ID-namespaced index to avoid cross-run pollution.
@Before / @After lifecycle cleans up test indices.
Additional Context
- Suite constraint:
OpenSearchUpgradeSuite is activated via -Dopensearch.upgrade.test=true (starts opensearch-upgrade Docker container on port 9201).
- Run command:
```
./mvnw verify -pl :dotcms-integration -Dcoreit.test.skip=false -Dopensearch.upgrade.test=true
```
- Reference implementations:
ContentletIndexOperationsOSIntegrationTest (same package), ESContentFactoryImplTest (ES baseline).
- Related class:
IndexConfigHelper.MigrationPhase (phase logic lives here).
Description
ContentFactoryIndexOperationsOSis the OS delegate insideESContentFactoryImpl:```java
private final ContentFactoryIndexOperations indexOperationsES;
private final ContentFactoryIndexOperations indexOperationsOS; // ← no coverage
```
The ES counterpart (
ContentFactoryIndexOperationsES) has coverage through the existingESContentFactoryImplTest. The OS implementation has zero integration test coverage.A parallel test class —
ContentFactoryIndexOperationsOSIntegrationTest— must be created following the same structure as the already-existingContentletIndexOperationsOSIntegrationTest(which coversContentletIndexOperationsOSagainst a live OS 3.x container).Acceptance Criteria
ContentFactoryIndexOperationsOSIntegrationTestis created underdotcms-integration/.../content/index/opensearch/.OpenSearchUpgradeSuite(only suite with a live OS 3.x instance).ContentFactoryIndexOperationsthat are implemented by the OS delegate are covered:createBulkRequest()— returns a non-null, empty requestaddIndexOp()/addDeleteOp()— increase bulk request sizeputToIndex()— document is visible after refresh; empty batch is a no-opcreateBulkProcessor()— returns non-null processor; flush on close persists the documentaddIndexOpToProcessor()/addDeleteOpToProcessor()— document appears / disappears after flushgetIndexDocumentCount()— returns 0 for an empty index, correct count after writesOpenSearchUpgradeSuiteis the only suite that provides a live OS instance, or identify an alternative suite where these tests could also run. Document findings in the PR description.RUN_ID-namespaced index to avoid cross-run pollution.@Before/@Afterlifecycle cleans up test indices.Additional Context
OpenSearchUpgradeSuiteis activated via-Dopensearch.upgrade.test=true(startsopensearch-upgradeDocker container on port 9201).```
./mvnw verify -pl :dotcms-integration -Dcoreit.test.skip=false -Dopensearch.upgrade.test=true
```
ContentletIndexOperationsOSIntegrationTest(same package),ESContentFactoryImplTest(ES baseline).IndexConfigHelper.MigrationPhase(phase logic lives here).