mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
REPO-1059: REST API: Invalid orderBy field is ignored
- additional fix + test case git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130593 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -148,22 +148,32 @@ public class RecognizedParamsExtractorTest implements RecognizedParamsExtractor
|
||||
assertEquals("name", theSort.get(1).column);
|
||||
assertTrue(theSort.get(1).asc);
|
||||
|
||||
try
|
||||
{
|
||||
getSort("age asc, name des"); // nvalid, should be desc
|
||||
fail("Should throw an InvalidSelectException");
|
||||
}
|
||||
catch (InvalidArgumentException error)
|
||||
{
|
||||
// this is correct
|
||||
}
|
||||
|
||||
theSort = getSort("name asc,"); // trailing comma is ignored
|
||||
theSort = getSort("name asc,"); // ok for now, trailing comma is ignored
|
||||
assertNotNull(theSort);
|
||||
assertTrue("Must have a value for column: NAME", !theSort.isEmpty());
|
||||
assertTrue(theSort.size() == 1);
|
||||
assertEquals("name", theSort.get(0).column);
|
||||
assertTrue(theSort.get(0).asc);
|
||||
|
||||
try
|
||||
{
|
||||
getSort("age asc, name des"); // invalid, should be desc
|
||||
fail("Should throw an InvalidArgumentException");
|
||||
}
|
||||
catch (InvalidArgumentException error)
|
||||
{
|
||||
// this is correct
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
getSort("age asc name"); // invalid, missing comma
|
||||
fail("Should throw an InvalidArgumentException");
|
||||
}
|
||||
catch (InvalidArgumentException error)
|
||||
{
|
||||
// this is correct
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user