mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
SEARCH-1989 Allow checking ordered values returned in a column. (#6)
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package org.alfresco.cmis.dsl;
|
package org.alfresco.cmis.dsl;
|
||||||
|
|
||||||
|
import static java.util.stream.Collectors.toList;
|
||||||
import static java.util.stream.Collectors.toSet;
|
import static java.util.stream.Collectors.toSet;
|
||||||
|
|
||||||
import static org.alfresco.utility.Utility.checkObjectIsInitialized;
|
import static org.alfresco.utility.Utility.checkObjectIsInitialized;
|
||||||
@@ -237,6 +238,16 @@ public class QueryExecutor
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public <T> QueryResultAssertion isReturningOrderedValues(String queryName, List<T> values)
|
||||||
|
{
|
||||||
|
STEP(String.format("Verify that query: '%s' returns the values from %s for column %s", currentQuery, values, queryName));
|
||||||
|
List<T> resultList = Streams.stream(results).map(r -> (T) r.getPropertyValueByQueryName(queryName)).collect(toList());
|
||||||
|
// Include both lists in assertion message as TestNG does not provide this information.
|
||||||
|
Assert.assertEquals(resultList, values, "Values did not match expected " + values + " but found " + resultList);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
private String showErrorMessage()
|
private String showErrorMessage()
|
||||||
{
|
{
|
||||||
return String.format("Returned results count of Query [%s] is not the expected one:", currentQuery);
|
return String.format("Returned results count of Query [%s] is not the expected one:", currentQuery);
|
||||||
|
Reference in New Issue
Block a user