diff --git a/e2e-test/java/org/alfresco/rest/search/SearchTest.java b/e2e-test/java/org/alfresco/rest/search/SearchTest.java index 8d6d97a28..5f902ff40 100644 --- a/e2e-test/java/org/alfresco/rest/search/SearchTest.java +++ b/e2e-test/java/org/alfresco/rest/search/SearchTest.java @@ -20,6 +20,8 @@ package org.alfresco.rest.search; import junit.framework.Assert; import org.alfresco.rest.model.body.RestNodeLockBodyModel; +import org.alfresco.utility.model.FileModel; +import org.alfresco.utility.model.FileType; import org.alfresco.utility.model.TestGroup; import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.annotation.TestRail; @@ -180,4 +182,25 @@ public class SearchTest extends AbstractSearchTest restClient.onResponse().assertThat().body("list.entries.entry[0].name", Matchers.nullValue()); restClient.onResponse().assertThat().body("list.entries.entry[0].id", Matchers.nullValue()); } + + @Test(groups = { TestGroup.SEARCH, TestGroup.REST_API }) + public void searchSpecialCharacters() throws Exception + { + // Create a file with Special Characters + String specialCharfileName = "è¥äæ§ç§-åæ.pdf"; + FileModel file = new FileModel(specialCharfileName, "è¥äæ§ç§-忬¯¸" + "è¥äæ§ç§-忬¯¸", "è¥äæ§ç§-忬¯¸", FileType.TEXT_PLAIN, + "Text file with Special Characters: " + specialCharfileName); + dataContent.usingUser(userModel).usingSite(siteModel).createContent(file); + + waitForIndexing(file.getName(), true); + + // Search + SearchRequest searchReq = createQuery("name:'" + specialCharfileName + "'"); + SearchResponse nodes = query(searchReq); + + restClient.assertStatusCodeIs(HttpStatus.OK); + nodes.assertThat().entriesListIsNotEmpty(); + + restClient.onResponse().assertThat().body("list.entries.entry[0].name", Matchers.equalToIgnoringCase(specialCharfileName)); + } }