From f6c2a408c2061026929269fe698d8e08b5bb51c3 Mon Sep 17 00:00:00 2001 From: KikoUK Date: Mon, 31 Oct 2022 14:28:36 +0000 Subject: [PATCH] ACS-3885: Fix failing e2es --- e2e-test/pom.xml | 4 ++-- .../solr/SearchSolrAPITest.java | 22 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/e2e-test/pom.xml b/e2e-test/pom.xml index d70ff909d..13329901d 100644 --- a/e2e-test/pom.xml +++ b/e2e-test/pom.xml @@ -10,7 +10,7 @@ Search Analytics E2E Tests Test Project to test Search Service and Analytics Features on a complete setup of Alfresco, Share - 1.101 + 1.135 1.31 3.0.49 3.3.1 @@ -174,4 +174,4 @@ - \ No newline at end of file + diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/SearchSolrAPITest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/SearchSolrAPITest.java index 85b0d19c0..fba8124d9 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/SearchSolrAPITest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/solr/SearchSolrAPITest.java @@ -45,18 +45,18 @@ import org.testng.annotations.Test; public class SearchSolrAPITest extends AbstractE2EFunctionalTest { @Test(priority = 1) - public void testGetSolrConfig() throws Exception + public void testGetSolrConfig() { RestTextResponse response = restClient.authenticateUser(adminUserModel).withSolrAPI().getConfig(); restClient.assertStatusCodeIs(HttpStatus.OK); - restClient.onResponse().assertThat().content(Matchers.containsString("config")); + restClient.onResponse().assertThat().body(Matchers.containsString("config")); Assert.assertNotNull(response.getJsonValueByPath("config.requestHandler")); Assert.assertNotNull(response.getJsonObjectByPath("config.requestHandler")); // TODO: Following asserts fail with error: /* - * java.lang.IllegalStateException: Expected response body to be verified as JSON, HTML or XML but content-type 'text/plain' is not supported out of the box. + * java.lang.IllegalStateException: Expected response body to be verified as JSON, HTML or XML but body-type 'text/plain' is not supported out of the box. * Try registering a custom parser using: RestAssured.registerParser("text/plain", ); */ @@ -65,7 +65,7 @@ public class SearchSolrAPITest extends AbstractE2EFunctionalTest } @Test(priority = 2) - public void testEditSolrConfig() throws Exception + public void testEditSolrConfig() { String expectedError = "solrconfig editing is not enabled due to disable.configEdit"; @@ -85,11 +85,11 @@ public class SearchSolrAPITest extends AbstractE2EFunctionalTest restClient.authenticateUser(adminUserModel).withSolrAPI().postConfig(postBody); restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN); - restClient.onResponse().assertThat().content(Matchers.containsString(expectedError)); + restClient.onResponse().assertThat().body(Matchers.containsString(expectedError)); // TODO: Following asserts fail with error: /* - * java.lang.IllegalStateException: Expected response body to be verified as JSON, HTML or XML but content-type 'text/plain' is not supported out of the box. + * java.lang.IllegalStateException: Expected response body to be verified as JSON, HTML or XML but body-type 'text/plain' is not supported out of the box. * Try registering a custom parser using: RestAssured.registerParser("text/plain", ); */ @@ -97,21 +97,21 @@ public class SearchSolrAPITest extends AbstractE2EFunctionalTest } @Test(priority = 3) - public void testGetSolrConfigOverlay() throws Exception + public void testGetSolrConfigOverlay() { restClient.authenticateUser(adminUserModel).withSolrAPI().getConfigOverlay(); restClient.assertStatusCodeIs(HttpStatus.OK); - restClient.onResponse().assertThat().content(Matchers.containsString("overlay")); + restClient.onResponse().assertThat().body(Matchers.containsString("overlay")); } @Test(priority = 4) - public void testGetSolrConfigParams() throws Exception + public void testGetSolrConfigParams() { restClient.authenticateUser(adminUserModel).withSolrAPI().getConfigParams(); restClient.assertStatusCodeIs(HttpStatus.OK); - restClient.onResponse().assertThat().content(Matchers.containsString("response")); + restClient.onResponse().assertThat().body(Matchers.containsString("response")); } @Test(priority = 5) @@ -127,4 +127,4 @@ public class SearchSolrAPITest extends AbstractE2EFunctionalTest String errorMsg = "No QueryObjectBuilder defined for node a in {q={!xmlparser"; Assert.assertTrue(restClient.onResponse().getResponse().body().xmlPath().getString("response").contains(errorMsg)); } -} \ No newline at end of file +}