mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
Merge pull request #1200 from Alfresco/feature/SEARCH-2909_ExactTermSearch501Test
SEARCH-2909 Add test for 501 error being returned when exact term search is not available.
This commit is contained in:
@@ -44,6 +44,8 @@ public class TestGroup
|
||||
|
||||
public static final String CONFIG_ENABLED_CASCADE_TRACKER ="Config_Enabled_Cascade_Tracker"; // Alfresco search services does not index fields related to cascaded updates
|
||||
|
||||
public static final String CROSS_LOCALE_SUPPORT_DISABLED = "CROSS_LOCALE_SUPPORT_DISABLED";
|
||||
|
||||
public static final String NOT_INSIGHT_ENGINE = "Not_InsightEngine"; // When Alfresco Insight Engine 1.0 isn't running
|
||||
|
||||
public static final String ACS_52n = "ACS_52n"; // Alfresco Content Services 5.2.n
|
||||
@@ -52,6 +54,7 @@ public class TestGroup
|
||||
public static final String ACS_611n = "ACS_611n"; // Alfresco Content Services 6.1.1 or above
|
||||
public static final String ACS_62n = "ACS_62n"; // Alfresco Content Services 6.2 or above
|
||||
public static final String ACS_63n = "ACS_63n"; // Alfresco Content Services 6.3 or above
|
||||
public static final String ACS_71n = "ACS_71n"; // Alfresco Content Services 7.1 or above
|
||||
|
||||
public static final String AGS_302 = "AGS_302"; // Alfresco governance Services 3.0.2 or above
|
||||
}
|
||||
|
||||
+31
@@ -29,6 +29,8 @@ package org.alfresco.test.search.functional.searchServices.search;
|
||||
import static java.util.List.of;
|
||||
|
||||
import static jersey.repackaged.com.google.common.collect.Sets.newHashSet;
|
||||
import static org.alfresco.search.TestGroup.ACS_71n;
|
||||
import static org.alfresco.search.TestGroup.CROSS_LOCALE_SUPPORT_DISABLED;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -37,12 +39,15 @@ import java.util.stream.Stream;
|
||||
|
||||
import org.alfresco.rest.model.RestNodeAssociationModelCollection;
|
||||
import org.alfresco.rest.model.RestNodeChildAssociationModel;
|
||||
import org.alfresco.rest.search.RestRequestQueryModel;
|
||||
import org.alfresco.rest.search.SearchRequest;
|
||||
import org.alfresco.rest.search.SearchResponse;
|
||||
import org.alfresco.search.TestGroup;
|
||||
import org.alfresco.test.search.functional.AbstractE2EFunctionalTest;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.FileType;
|
||||
import org.alfresco.utility.model.FolderModel;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
@@ -342,4 +347,30 @@ public class SearchAFTSInFieldTest extends AbstractE2EFunctionalTest
|
||||
fileFound = isContentInSearchResponse(response, file3.getName());
|
||||
Assert.assertFalse(fileFound, "File3 found for query: " + query);
|
||||
}
|
||||
|
||||
/** Check that a 501 error is returned when performing exact search on a tokenised field without cross-locale support. */
|
||||
@Test (priority = 12, groups = { CROSS_LOCALE_SUPPORT_DISABLED, ACS_71n })
|
||||
public void testExactMatchWithoutCrossLocale()
|
||||
{
|
||||
// Force the query to hit Solr rather than the DB.
|
||||
String query = "=cm:title:test and cm:name:*";
|
||||
RestRequestQueryModel queryModel = new RestRequestQueryModel();
|
||||
queryModel.setQuery(query);
|
||||
SearchRequest searchRequest = new SearchRequest(queryModel);
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).withSearchAPI().search(searchRequest);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/** Check that a 200 success is returned when performing exact search against the DB (even on a tokenised field without cross-locale support). */
|
||||
@Test (priority = 13)
|
||||
public void testExactMatchAgainstDB()
|
||||
{
|
||||
// Using a simple query we will hit the DB.
|
||||
String query = "=cm:title:test";
|
||||
RestRequestQueryModel queryModel = new RestRequestQueryModel();
|
||||
queryModel.setQuery(query);
|
||||
SearchRequest searchRequest = new SearchRequest(queryModel);
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).withSearchAPI().search(searchRequest);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -65,8 +65,9 @@ public class SearchQueryPaginationTest extends AbstractCmisE2ETest
|
||||
|
||||
waitForMetadataIndexing(testFile.getName(), true);
|
||||
}
|
||||
|
||||
@Test(priority = 1, groups = { TestGroup.ACS_62n})
|
||||
|
||||
/** Disabled due to SEARCH-2948. */
|
||||
@Test(enabled = false, priority = 1, groups = { TestGroup.ACS_62n})
|
||||
public void testCmisSearchWithPagination()
|
||||
{
|
||||
// Search for the cmis documents using cmis query
|
||||
@@ -141,7 +142,8 @@ public class SearchQueryPaginationTest extends AbstractCmisE2ETest
|
||||
Assert.assertTrue(response.isEmpty(), "Empty Response, Error is expected when skipCount < 0");
|
||||
}
|
||||
|
||||
@Test(priority = 2, groups = { TestGroup.ACS_62n})
|
||||
/** Disabled due to SEARCH-2948. */
|
||||
@Test(enabled = false, priority = 2, groups = { TestGroup.ACS_62n})
|
||||
public void testPagination()
|
||||
{
|
||||
// Search for the files under the testFolder using cmis query
|
||||
|
||||
Reference in New Issue
Block a user