REPO-1635: V1 REST API - minor fix for error code (update node/people details)

- invalid data type conversion should return 400 instead of 500
- REPO-1635, REPO-1641

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@133168 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2016-11-28 09:37:35 +00:00
parent a85512572b
commit 3f6c638929
2 changed files with 17 additions and 0 deletions

View File

@@ -3058,6 +3058,22 @@ public class NodeApiTest extends AbstractSingleNetworkSiteTest
fUpdate.setProperties(props);
put(URL_NODES, f2Id, toJsonAsStringNonNull(fUpdate), null, 400);
// -ve test - minor: error code if trying to update property with invalid format (REPO-1635)
props = new HashMap<>();
props.put("exif:dateTimeOriginal", "25-11-2016");
fUpdate = new Folder();
fUpdate.setProperties(props);
put(URL_NODES, f2Id, toJsonAsStringNonNull(fUpdate), null, 400);
// +ve test - try again with valid formats (REPO-473, REPO-1635)
props = new HashMap<>();
props.put("exif:pixelYDimension", "123");
props.put("exif:dateTimeOriginal", "2016-11-21T16:26:19.037+0000");
fUpdate = new Folder();
fUpdate.setProperties(props);
put(URL_NODES, f2Id, toJsonAsStringNonNull(fUpdate), null, 200);
// -ve test - non-admin cannot modify root (Company Home) folder
props = new HashMap<>();
props.put("cm:description", "my folder description");