minor updates of the java doc and code style

This commit is contained in:
Rodica Sutu
2019-08-21 14:41:05 +03:00
parent 4ad9ee2afa
commit fa18f3d58b
4 changed files with 17 additions and 26 deletions

View File

@@ -67,6 +67,7 @@ public class HoldsAPI extends BaseAPI
* The URI to add items to hold or to remove items from hold * The URI to add items to hold or to remove items from hold
*/ */
private static final String RM_HOLDS_API = "{0}rma/holds"; private static final String RM_HOLDS_API = "{0}rma/holds";
/** /**
* The URI to get holds. * The URI to get holds.
*/ */
@@ -118,7 +119,6 @@ public class HoldsAPI extends BaseAPI
* @param description hold description * @param description hold description
* @return node ref of the hold created * @return node ref of the hold created
*/ */
public String createHoldAndGetNodeRef(String user, String password, public String createHoldAndGetNodeRef(String user, String password,
String holdName, String reason, String description) String holdName, String reason, String description)
{ {
@@ -141,8 +141,6 @@ public class HoldsAPI extends BaseAPI
return null; return null;
} }
/** /**
* Deletes hold * Deletes hold
* *
@@ -203,7 +201,8 @@ public class HoldsAPI extends BaseAPI
} }
/** /**
* Util method to create the request body used adding an item to hold or to remove items from hold * Util method to create the request body used when adding an item to holds or when removing an item from holds
*
* @param user user to create the request body for add/remove an item to/from hold * @param user user to create the request body for add/remove an item to/from hold
* @param password the user's password * @param password the user's password
* @param itemNodeRef node ref to be added to hold * @param itemNodeRef node ref to be added to hold

View File

@@ -221,12 +221,10 @@ public class AddToHoldsTests extends BaseRMRestTest
public void addValidNodesToHoldWithAllowedUser(String nodeId) throws Exception public void addValidNodesToHoldWithAllowedUser(String nodeId) throws Exception
{ {
STEP("Add node to hold with user with permission."); STEP("Add node to hold with user with permission.");
holdsAPI.addItemToHold(userAddHoldPermission.getUsername(), userAddHoldPermission.getPassword(), holdsAPI.addItemToHold(userAddHoldPermission.getUsername(), userAddHoldPermission.getPassword(), nodeId, HOLD);
nodeId, HOLD);
STEP("Check the node is frozen."); STEP("Check the node is frozen.");
assertTrue(hasAspect(nodeId, FROZEN_ASPECT)); assertTrue(hasAspect(nodeId, FROZEN_ASPECT));
} }
/** /**
@@ -284,8 +282,7 @@ public class AddToHoldsTests extends BaseRMRestTest
* @throws Exception * @throws Exception
*/ */
@Test (dataProvider = "userWithoutPermissionForAddToHold") @Test (dataProvider = "userWithoutPermissionForAddToHold")
public void addContentToHoldWithUserWithoutHoldPermission(UserModel userModel, String nodeToBeAddedToHold) throws public void addContentToHoldWithUserWithoutHoldPermission(UserModel userModel, String nodeToBeAddedToHold) throws Exception
Exception
{ {
users.add(userModel); users.add(userModel);
STEP("Add the node to the hold with user without permission."); STEP("Add the node to the hold with user without permission.");
@@ -295,10 +292,8 @@ public class AddToHoldsTests extends BaseRMRestTest
STEP("Check the node is not frozen."); STEP("Check the node is not frozen.");
assertFalse(hasAspect(nodeToBeAddedToHold,FROZEN_ASPECT)); assertFalse(hasAspect(nodeToBeAddedToHold,FROZEN_ASPECT));
} }
/** /**
* Data provider with invalid node types that can be added to a hold * Data provider with invalid node types that can be added to a hold
*/ */
@@ -319,7 +314,7 @@ public class AddToHoldsTests extends BaseRMRestTest
//transfer container //transfer container
{ getTransferContainer(TRANSFERS_ALIAS).getId(), SC_BAD_REQUEST, INVALID_TYPE_ERROR_MESSAGE }, { getTransferContainer(TRANSFERS_ALIAS).getId(), SC_BAD_REQUEST, INVALID_TYPE_ERROR_MESSAGE },
// a record category // a record category
{ category.getId(), SC_INTERNAL_SERVER_ERROR, ACCESS_DENIED_ERROR_MESSAGE }, { category.getId(), SC_BAD_REQUEST, INVALID_TYPE_ERROR_MESSAGE },
// unfiled records root // unfiled records root
{ getUnfiledContainer(UNFILED_RECORDS_CONTAINER_ALIAS).getId(), SC_BAD_REQUEST, { getUnfiledContainer(UNFILED_RECORDS_CONTAINER_ALIAS).getId(), SC_BAD_REQUEST,
INVALID_TYPE_ERROR_MESSAGE }, INVALID_TYPE_ERROR_MESSAGE },

View File

@@ -80,7 +80,7 @@ public class PreventActionsOnFrozenContentTests extends BaseRMRestTest
contentHeld = dataContent.usingAdmin().usingSite(testSite) contentHeld = dataContent.usingAdmin().usingSite(testSite)
.createContent(CMISUtil.DocumentType.TEXT_PLAIN); .createContent(CMISUtil.DocumentType.TEXT_PLAIN);
STEP("Add the content to the hold."); STEP("Add the file to the hold.");
holdsAPI.addItemToHold(getAdminUser().getUsername(), getAdminUser().getPassword(), contentHeld holdsAPI.addItemToHold(getAdminUser().getUsername(), getAdminUser().getPassword(), contentHeld
.getNodeRefWithoutVersion(), HOLD_ONE); .getNodeRefWithoutVersion(), HOLD_ONE);
@@ -91,6 +91,7 @@ public class PreventActionsOnFrozenContentTests extends BaseRMRestTest
folderModel = dataContent.usingAdmin().usingSite(testSite) folderModel = dataContent.usingAdmin().usingSite(testSite)
.createFolder(); .createFolder();
} }
/** /**
* Given active content on hold * Given active content on hold
* When I try to edit the properties * When I try to edit the properties
@@ -108,7 +109,6 @@ public class PreventActionsOnFrozenContentTests extends BaseRMRestTest
STEP("Check the request failed."); STEP("Check the request failed.");
restClient.assertStatusCodeIs(FORBIDDEN); restClient.assertStatusCodeIs(FORBIDDEN);
restClient.assertLastError().containsSummary("Frozen nodes can not be updated."); restClient.assertLastError().containsSummary("Frozen nodes can not be updated.");
} }
/* /*
@@ -126,8 +126,8 @@ public class PreventActionsOnFrozenContentTests extends BaseRMRestTest
STEP("Check the request failed."); STEP("Check the request failed.");
restClient.assertStatusCodeIs(FORBIDDEN); restClient.assertStatusCodeIs(FORBIDDEN);
restClient.assertLastError().containsSummary("Frozen nodes can not be updated."); restClient.assertLastError().containsSummary("Frozen nodes can not be updated.");
} }
/* /*
* Given active content on hold * Given active content on hold
* When I try to delete the content * When I try to delete the content
@@ -142,7 +142,6 @@ public class PreventActionsOnFrozenContentTests extends BaseRMRestTest
STEP("Check the request failed."); STEP("Check the request failed.");
restClient.assertStatusCodeIs(FORBIDDEN); restClient.assertStatusCodeIs(FORBIDDEN);
restClient.assertLastError().containsSummary("Frozen nodes can not be deleted."); restClient.assertLastError().containsSummary("Frozen nodes can not be deleted.");
} }
/** /**
@@ -186,7 +185,6 @@ public class PreventActionsOnFrozenContentTests extends BaseRMRestTest
{ {
holdsAPI.deleteHold(getAdminUser().getUsername(), getAdminUser().getPassword(), HOLD_ONE); holdsAPI.deleteHold(getAdminUser().getUsername(), getAdminUser().getPassword(), HOLD_ONE);
dataSite.usingAdmin().deleteSite(testSite); dataSite.usingAdmin().deleteSite(testSite);
} }
} }

View File

@@ -104,7 +104,7 @@ public class RemoveFromHoldsTests extends BaseRMRestTest
contentAddToManyHolds = dataContent.usingSite(testSite) contentAddToManyHolds = dataContent.usingSite(testSite)
.createContent(CMISUtil.DocumentType.TEXT_PLAIN); .createContent(CMISUtil.DocumentType.TEXT_PLAIN);
STEP("Add the content to the holds."); STEP("Add content to the holds.");
holdsAPI.addItemToHold(getAdminUser().getUsername(), getAdminUser().getPassword(), contentHeld holdsAPI.addItemToHold(getAdminUser().getUsername(), getAdminUser().getPassword(), contentHeld
.getNodeRefWithoutVersion(), HOLD_ONE); .getNodeRefWithoutVersion(), HOLD_ONE);
holdsAPI.addItemToHold(getAdminUser().getUsername(), getAdminUser().getPassword(), contentAddToManyHolds holdsAPI.addItemToHold(getAdminUser().getUsername(), getAdminUser().getPassword(), contentAddToManyHolds
@@ -194,7 +194,7 @@ public class RemoveFromHoldsTests extends BaseRMRestTest
/** /**
* Data provider with user without right permission or capability to remove from hold a specific node * Data provider with user without right permission or capability to remove from hold a specific node
* @return * @return user model and the node ref to be removed from hold
* @throws Exception * @throws Exception
*/ */
@DataProvider (name = "userWithoutPermissionForRemoveFromHold") @DataProvider (name = "userWithoutPermissionForRemoveFromHold")
@@ -263,7 +263,6 @@ public class RemoveFromHoldsTests extends BaseRMRestTest
STEP("Check node is frozen."); STEP("Check node is frozen.");
assertTrue(hasAspect(nodeIdToBeRemoved, FROZEN_ASPECT)); assertTrue(hasAspect(nodeIdToBeRemoved, FROZEN_ASPECT));
} }
@AfterClass (alwaysRun = true) @AfterClass (alwaysRun = true)