From a24fcb08e33e393e0a9dad72a9c4e724e61230c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20=C5=BBurek?= Date: Mon, 10 Jun 2024 12:29:29 +0200 Subject: [PATCH] Revert "Try to change the order" This reverts commit 14a3e9582f2cbeae1314391f019ff676333be525. --- .../solr/admin/SolrE2eAdminTest.java | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) 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 40bda4e1e..3c3718c8b 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,51 +73,6 @@ 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 @@ -654,6 +609,51 @@ 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