Merged 5.2.0 (5.2.0) to HEAD (5.2)

133168 jvonka: 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/HEAD/root@133398 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-12-06 17:21:37 +00:00
parent 69e596c5e0
commit 56f81c38b5
2 changed files with 17 additions and 0 deletions

View File

@@ -143,6 +143,7 @@
<entry key="org.alfresco.service.cmr.repository.CyclicChildRelationshipException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_BAD_REQUEST}" /> <entry key="org.alfresco.service.cmr.repository.CyclicChildRelationshipException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_BAD_REQUEST}" />
<entry key="org.alfresco.rest.framework.core.exceptions.InvalidArgumentException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_BAD_REQUEST}" /> <entry key="org.alfresco.rest.framework.core.exceptions.InvalidArgumentException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_BAD_REQUEST}" />
<entry key="org.alfresco.service.cmr.version.VersionServiceException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_BAD_REQUEST}" /> <entry key="org.alfresco.service.cmr.version.VersionServiceException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_BAD_REQUEST}" />
<entry key="org.alfresco.service.cmr.repository.datatype.TypeConversionException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_BAD_REQUEST}" />
<entry key="org.alfresco.rest.framework.core.exceptions.NotFoundException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_NOT_FOUND}" /> <entry key="org.alfresco.rest.framework.core.exceptions.NotFoundException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_NOT_FOUND}" />
<entry key="org.alfresco.rest.framework.core.exceptions.EntityNotFoundException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_NOT_FOUND}" /> <entry key="org.alfresco.rest.framework.core.exceptions.EntityNotFoundException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_NOT_FOUND}" />
<entry key="org.alfresco.service.cmr.repository.InvalidNodeRefException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_NOT_FOUND}" /> <entry key="org.alfresco.service.cmr.repository.InvalidNodeRefException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_NOT_FOUND}" />

View File

@@ -3058,6 +3058,22 @@ public class NodeApiTest extends AbstractSingleNetworkSiteTest
fUpdate.setProperties(props); fUpdate.setProperties(props);
put(URL_NODES, f2Id, toJsonAsStringNonNull(fUpdate), null, 400); 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 // -ve test - non-admin cannot modify root (Company Home) folder
props = new HashMap<>(); props = new HashMap<>();
props.put("cm:description", "my folder description"); props.put("cm:description", "my folder description");