From ccdecbdeb28f3ab0fa20c6efda7aa4497e8c320a Mon Sep 17 00:00:00 2001 From: mbhave Date: Thu, 30 Apr 2020 10:27:06 +0100 Subject: [PATCH] Search-2203: Missed out hunk for testExpand from the commit --- .../searchServices/solr/admin/SolrE2eAdminTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 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 b0ea83733..20666ad8c 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 @@ -517,11 +517,17 @@ public class SolrE2eAdminTest extends AbstractE2EFunctionalTest if (ShardingMethod.DB_ID_RANGE.toString().equalsIgnoreCase(getShardMethod())) { // This assertion replicates: testExpandSharding, priority = 23, hence deleting that test as duplicate - Assert.assertNotEquals(expand, Integer.valueOf(-1), "Expansion is not successful when not using Shard DB_ID_RANGE method,"); + Assert.assertTrue((expand == Integer.valueOf(-1) || expand == Integer.valueOf(0)), "Expansion is not successful when not using Shard DB_ID_RANGE method,"); + if (expand == Integer.valueOf(-1)) + { + String exceptionExpected = "Expansion cannot occur if max DBID in the index is more then 75% of range."; + String exception = response.getResponse().body().jsonPath().get("exception"); + Assert.assertEquals(exception, exceptionExpected, "Expansion failed with unexpected Exception while using DB_ID_RANGE sharding"); + } } else { - Assert.assertEquals(expand, Integer.valueOf(-1), "Expansion should not have been allowed when not using Shard DB_ID_RANGE method,"); + Assert.assertEquals(expand, Integer.valueOf(-1), "Expansion should not have been allowed when not using Shard DB_ID_RANGE method"); } }