mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
REPO-2520: Community: SiteMembership Java API calls should tell which site resulted in errors
Changed tests asserts from (actual value, expected value) to (expected value, actual value) as recommended in the Junit Assert Javadoc. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@137771 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -788,6 +788,7 @@ public class TestNodeComments extends EnterpriseTestApi
|
||||
Comments commentsProxy = publicApiClient.comments();
|
||||
|
||||
// locked node - cannot add/edit/delete comments (MNT-14945, MNT-16446)
|
||||
// only the lock owner can (ALF-21907)
|
||||
|
||||
try
|
||||
{
|
||||
@@ -805,15 +806,15 @@ public class TestNodeComments extends EnterpriseTestApi
|
||||
repoService.lockNode(nodeRef1);
|
||||
return null;
|
||||
}
|
||||
}, person11.getId(), network1.getId());
|
||||
}, person13.getId(), network1.getId());
|
||||
|
||||
publicApiClient.setRequestContext(new RequestContext(network1.getId(), person11.getId()));
|
||||
// change to not lock owner
|
||||
publicApiClient.setRequestContext(new RequestContext(network1.getId(), person14.getId()));
|
||||
|
||||
// test GET for a locked node
|
||||
|
||||
int skipCount = 0;
|
||||
int maxItems = Integer.MAX_VALUE;
|
||||
Paging paging = getPaging(skipCount, maxItems);
|
||||
int skipCount = 0;
|
||||
int maxItems = Integer.MAX_VALUE;
|
||||
Paging paging = getPaging(skipCount, maxItems);
|
||||
commentsProxy.getNodeComments(nodeRef1.getId(), createParams(paging, null));
|
||||
|
||||
// test POST for a locked node
|
||||
@@ -853,8 +854,27 @@ public class TestNodeComments extends EnterpriseTestApi
|
||||
}
|
||||
catch (PublicApiException e)
|
||||
{
|
||||
assertEquals(HttpStatus.SC_CONFLICT, e.getHttpResponse().getStatusCode());
|
||||
assertEquals(HttpStatus.SC_FORBIDDEN, e.getHttpResponse().getStatusCode());
|
||||
}
|
||||
|
||||
// change to lock owner
|
||||
publicApiClient.setRequestContext(new RequestContext(network1.getId(), person13.getId()));
|
||||
|
||||
// test GET for a locked node
|
||||
commentsProxy.getNodeComments(nodeRef1.getId(), createParams(paging, null));
|
||||
|
||||
// test POST for a locked node
|
||||
comment = new Comment();
|
||||
comment.setContent("my other comment");
|
||||
createdComment = commentsProxy.createNodeComment(nodeRef1.getId(), comment);
|
||||
|
||||
// test PUT for a locked node
|
||||
Comment updatedComment = new Comment();
|
||||
updatedComment.setContent("my comment");
|
||||
commentsProxy.updateNodeComment(nodeRef1.getId(), createdComment.getId(), updatedComment);
|
||||
|
||||
// test DELETE for a locked node
|
||||
commentsProxy.removeNodeComment(nodeRef1.getId(), createdComment.getId());
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
Reference in New Issue
Block a user