Implement intial search test based on search api endpoint

This commit is contained in:
Michael Suzuki
2017-02-22 10:12:43 +00:00
parent 34d3614d18
commit ccab6f6593
2 changed files with 23 additions and 14 deletions
@@ -18,7 +18,6 @@
*/
package org.alfresco.rest.search;
import org.alfresco.rest.model.RestNodeModelsCollection;
import org.alfresco.utility.model.TestGroup;
import org.springframework.http.HttpStatus;
import org.testng.annotations.Test;
@@ -30,21 +29,22 @@ import org.testng.annotations.Test;
*/
public class SearchTest extends AbstractSearchTest
{
@Test(groups={TestGroup.SEARCH})
@Test(groups={TestGroup.SEARCH, TestGroup.REST_API})
public void searchCreatedData() throws Exception
{
RestNodeModelsCollection nodes = query("cars");
SearchResponse nodes = query("ipsum");
restClient.assertStatusCodeIs(HttpStatus.OK);
nodes.assertThat().entriesListIsNotEmpty();
nodes = query("fox");
restClient.assertStatusCodeIs(HttpStatus.OK);
nodes.assertThat().entriesListIsNotEmpty();
}
@Test(groups={TestGroup.SEARCH})
@Test(groups={TestGroup.SEARCH,TestGroup.REST_API})
public void searchNonIndexedData() throws Exception
{
RestNodeModelsCollection nodes = query("yeti");
SearchResponse nodes = query("yeti");
restClient.assertStatusCodeIs(HttpStatus.OK);
nodes.assertThat().entriesListIsEmpty();
}