From aa91d01a57b16a015965e4f3e4ab5ae96bf55082 Mon Sep 17 00:00:00 2001 From: Jan Vonka Date: Tue, 12 Jul 2016 12:01:03 +0000 Subject: [PATCH] Merged 5.2.N (5.2.1) to HEAD (5.2) 128387 jvonka: Merged 5.1.N (5.1.2) to 5.2.N (5.2.1) 128382 jvonka: MNT-16446: Edit Comment permission (part 3b) - follow-on to fix test fallout - for CMIS (and future v1 Nodes REST) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@128731 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/public-rest-context.xml | 1 + .../rest/api/tests/TestNodeComments.java | 44 +++++++++---------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/config/alfresco/public-rest-context.xml b/config/alfresco/public-rest-context.xml index dc0247a135..a927bde1cb 100644 --- a/config/alfresco/public-rest-context.xml +++ b/config/alfresco/public-rest-context.xml @@ -145,6 +145,7 @@ + diff --git a/source/test-java/org/alfresco/rest/api/tests/TestNodeComments.java b/source/test-java/org/alfresco/rest/api/tests/TestNodeComments.java index d752b10f89..238359a518 100644 --- a/source/test-java/org/alfresco/rest/api/tests/TestNodeComments.java +++ b/source/test-java/org/alfresco/rest/api/tests/TestNodeComments.java @@ -803,35 +803,33 @@ public class TestNodeComments extends EnterpriseTestApi } catch(PublicApiException e) { - assertEquals(HttpStatus.SC_FORBIDDEN, e.getHttpResponse().getStatusCode()); + assertEquals(HttpStatus.SC_CONFLICT, e.getHttpResponse().getStatusCode()); } // test PUT for a locked node + try { - TenantUtil.runAsUserTenant(new TenantRunAsWork() - { - @Override - public Void doWork() throws Exception - { - repoService.lockNode(nodeRef1); - return null; - } - }, person11.getId(), network1.getId()); + Comment updatedComment = new Comment(); + updatedComment.setContent("my comment"); + commentsProxy.updateNodeComment(nodeRef1.getId(), createdComment.getId(), updatedComment); - try - { - publicApiClient.setRequestContext(new RequestContext(network1.getId(), person11.getId())); + fail(""); + } + catch(PublicApiException e) + { + assertEquals(HttpStatus.SC_CONFLICT, e.getHttpResponse().getStatusCode()); + } - Comment updatedComment = new Comment(); - updatedComment.setContent("my comment"); - commentsProxy.updateNodeComment(nodeRef1.getId(), createdComment.getId(), updatedComment); - - fail(""); - } - catch(PublicApiException e) - { - assertEquals(HttpStatus.SC_FORBIDDEN, e.getHttpResponse().getStatusCode()); - } + // test DELETE for a locked node + try + { + commentsProxy.removeNodeComment(nodeRef1.getId(), createdComment.getId()); + + fail(""); + } + catch(PublicApiException e) + { + assertEquals(HttpStatus.SC_CONFLICT, e.getHttpResponse().getStatusCode()); } } finally