From 0174177c098524f6ac4777cd89dbd830d682e0a2 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Thu, 9 Nov 2017 16:17:15 +0000 Subject: [PATCH] Refactor test API calls to delete all items in container. --- .../java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java index 3705e38ac6..b3af63a3ab 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java @@ -268,15 +268,16 @@ public class RMRolesAndActionsAPI extends BaseAPI * @param password its password * @param siteId the site id in which the container is located * @param containerName the container to look for items into - * @return true if the deletion has been successful + * @throws AssertionError if not all items could be deleted. */ - public boolean deleteAllItemsInContainer(String username, String password, String siteId, String containerName) + public void deleteAllItemsInContainer(String username, String password, String siteId, String containerName) { for (CmisObject item : contentService.getFolderObject(contentService.getCMISSession(username, password), siteId, containerName).getChildren()) { item.delete(); } - return !(contentService.getFolderObject(contentService.getCMISSession(username, password), siteId, containerName).getChildren().getHasMoreItems()); + boolean success = !(contentService.getFolderObject(contentService.getCMISSession(username, password), siteId, containerName).getChildren().getHasMoreItems()); + assertTrue("Not all items were deleted from " + containerName, success); } /**