diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/admin/SolrE2eAdminTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/admin/SolrE2eAdminTest.java index 3c3718c8b..40bda4e1e 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/admin/SolrE2eAdminTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/admin/SolrE2eAdminTest.java @@ -73,6 +73,51 @@ public class SolrE2eAdminTest extends AbstractE2EFunctionalTest Assert.assertEquals(status, SOLR_RESPONSE_STATUS_OK, "Expected " + SOLR_RESPONSE_STATUS_OK + " in responseHeader.status,"); } + /** + * FIX for specific core. + * The test checks the response structure in order to make sure the expected sections are present. + * + * We are not testing the content of each section because due to the underlying E2E infrastructure, we cannot know + * in advance the transactions that will be scheduled for reindexing. + */ + @Test(priority = 0) + public void testFixCore() + { + DEFAULT_CORE_NAMES.forEach(core -> { + try + { + RestResponse response = restClient.withParams("core=" + core).withSolrAdminAPI().getAction("fix"); + + checkResponseStatusOk(response); + + Map txInIndexNotInDb = response.getResponse().body().jsonPath().get("action." + core +".txToReindex.txInIndexNotInDb"); + Assert.assertNotNull(txInIndexNotInDb, "Expected a list of transactions (even empty) that are in index but not in the database to be reindexed,"); + + Map duplicatedTx = response.getResponse().body().jsonPath().get("action." + core +".txToReindex.duplicatedTxInIndex"); + Assert.assertNotNull(duplicatedTx, "Expected a list of duplicated transactions (even empty) to be reindexed,"); + + Map missingTx = response.getResponse().body().jsonPath().get("action." + core +".txToReindex.missingTxInIndex"); + Assert.assertNotNull(missingTx, "Expected a list of missing transactions (or empty list) to be reindexed,"); + + Map aclTxInIndexNotInDb = response.getResponse().body().jsonPath().get("action." + core + ".aclChangeSetToReindex.aclTxInIndexNotInDb"); + Assert.assertNotNull(aclTxInIndexNotInDb, "Expected a list of ACLs (or empty list) to be reindexed,"); + + Map duplicatedAclTxInIndex = response.getResponse().body().jsonPath().get("action." + core + ".aclChangeSetToReindex.duplicatedAclTxInIndex"); + Assert.assertNotNull(duplicatedAclTxInIndex, "Expected a list of ACLs (or empty list) to be reindexed,"); + + Map missingAclTxInIndex = response.getResponse().body().jsonPath().get("action." + core + ".aclChangeSetToReindex.missingAclTxInIndex"); + Assert.assertNotNull(missingAclTxInIndex, "Expected a list of ACLs (or empty list) to be reindexed,"); + + String actionStatus = response.getResponse().body().jsonPath().get("action.status"); + Assert.assertEquals(actionStatus, "notScheduled"); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + }); + } + /** * Node Report for every core. * @throws Exception @@ -609,51 +654,6 @@ public class SolrE2eAdminTest extends AbstractE2EFunctionalTest }); } - /** - * FIX for specific core. - * The test checks the response structure in order to make sure the expected sections are present. - * - * We are not testing the content of each section because due to the underlying E2E infrastructure, we cannot know - * in advance the transactions that will be scheduled for reindexing. - */ - @Test(priority = 28) - public void testFixCore() - { - DEFAULT_CORE_NAMES.forEach(core -> { - try - { - RestResponse response = restClient.withParams("core=" + core).withSolrAdminAPI().getAction("fix"); - - checkResponseStatusOk(response); - - Map txInIndexNotInDb = response.getResponse().body().jsonPath().get("action." + core +".txToReindex.txInIndexNotInDb"); - Assert.assertNotNull(txInIndexNotInDb, "Expected a list of transactions (even empty) that are in index but not in the database to be reindexed,"); - - Map duplicatedTx = response.getResponse().body().jsonPath().get("action." + core +".txToReindex.duplicatedTxInIndex"); - Assert.assertNotNull(duplicatedTx, "Expected a list of duplicated transactions (even empty) to be reindexed,"); - - Map missingTx = response.getResponse().body().jsonPath().get("action." + core +".txToReindex.missingTxInIndex"); - Assert.assertNotNull(missingTx, "Expected a list of missing transactions (or empty list) to be reindexed,"); - - Map aclTxInIndexNotInDb = response.getResponse().body().jsonPath().get("action." + core + ".aclChangeSetToReindex.aclTxInIndexNotInDb"); - Assert.assertNotNull(aclTxInIndexNotInDb, "Expected a list of ACLs (or empty list) to be reindexed,"); - - Map duplicatedAclTxInIndex = response.getResponse().body().jsonPath().get("action." + core + ".aclChangeSetToReindex.duplicatedAclTxInIndex"); - Assert.assertNotNull(duplicatedAclTxInIndex, "Expected a list of ACLs (or empty list) to be reindexed,"); - - Map missingAclTxInIndex = response.getResponse().body().jsonPath().get("action." + core + ".aclChangeSetToReindex.missingAclTxInIndex"); - Assert.assertNotNull(missingAclTxInIndex, "Expected a list of ACLs (or empty list) to be reindexed,"); - - String actionStatus = response.getResponse().body().jsonPath().get("action.status"); - Assert.assertEquals(actionStatus, "notScheduled"); - } - catch (Exception e) - { - throw new RuntimeException(e); - } - }); - } - /** * REINDEX for every core. * @throws Exception