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
*/
private static final String RM_HOLDS_API = "{0}rma/holds";
/**
* The URI to get holds.
*/
@@ -118,7 +119,6 @@ public class HoldsAPI extends BaseAPI
* @param description hold description
* @return node ref of the hold created
*/
public String createHoldAndGetNodeRef(String user, String password,
String holdName, String reason, String description)
{
@@ -141,8 +141,6 @@ public class HoldsAPI extends BaseAPI
return null;
}
/**
* Deletes hold
*
@@ -157,7 +155,7 @@ public class HoldsAPI extends BaseAPI
}
/**
* Adds item (content /record/ record folder) to the hold
* Adds item(content/record/record folder) to the hold
*
* @param user the user who adds the item to the hold
* @param password the user's password
@@ -171,7 +169,7 @@ public class HoldsAPI extends BaseAPI
}
/**
* Adds item (content /record/ record folder) to the hold
* Adds item(content/record/record folder) to the hold
*
* @param user the user who adds the item to the hold
* @param password the user's password
@@ -187,7 +185,7 @@ public class HoldsAPI extends BaseAPI
}
/**
* Util method to add item ( content /record/ record folder) to the hold and get the error message
* Util method to add item(content/record/record folder) to the hold and get the error message
*
* @param user the user who adds the item to the hold
* @param password the user's password
@@ -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 password the user's password
* @param itemNodeRef node ref to be added to hold
@@ -228,7 +227,7 @@ public class HoldsAPI extends BaseAPI
}
/**
* Remove item ( content /record/ record folder) from the hold
* Remove item(content/record/record folder) from the hold
*
* @param user the user who removes the item from the hold
* @param password the user's password
@@ -242,7 +241,7 @@ public class HoldsAPI extends BaseAPI
}
/**
* Remove item (content/ record/ record folder) to the hold
* Remove item(content/record/record folder) to the hold
*
* @param user the user who adds the item to the hold
* @param password the user's password
@@ -259,7 +258,7 @@ public class HoldsAPI extends BaseAPI
}
/**
* Util method to remove item (content /record/ record folder) from hold and get the error message
* Util method to remove item(content/record/record folder) from hold and get the error message
*
* @param user the user who removes the item from hold
* @param password the user's password

View File

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

View File

@@ -80,7 +80,7 @@ public class PreventActionsOnFrozenContentTests extends BaseRMRestTest
contentHeld = dataContent.usingAdmin().usingSite(testSite)
.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
.getNodeRefWithoutVersion(), HOLD_ONE);
@@ -91,6 +91,7 @@ public class PreventActionsOnFrozenContentTests extends BaseRMRestTest
folderModel = dataContent.usingAdmin().usingSite(testSite)
.createFolder();
}
/**
* Given active content on hold
* When I try to edit the properties
@@ -108,7 +109,6 @@ public class PreventActionsOnFrozenContentTests extends BaseRMRestTest
STEP("Check the request failed.");
restClient.assertStatusCodeIs(FORBIDDEN);
restClient.assertLastError().containsSummary("Frozen nodes can not be updated.");
}
/*
@@ -126,8 +126,8 @@ public class PreventActionsOnFrozenContentTests extends BaseRMRestTest
STEP("Check the request failed.");
restClient.assertStatusCodeIs(FORBIDDEN);
restClient.assertLastError().containsSummary("Frozen nodes can not be updated.");
}
/*
* Given active content on hold
* When I try to delete the content
@@ -142,7 +142,6 @@ public class PreventActionsOnFrozenContentTests extends BaseRMRestTest
STEP("Check the request failed.");
restClient.assertStatusCodeIs(FORBIDDEN);
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);
dataSite.usingAdmin().deleteSite(testSite);
}
}

View File

@@ -104,7 +104,7 @@ public class RemoveFromHoldsTests extends BaseRMRestTest
contentAddToManyHolds = dataContent.usingSite(testSite)
.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
.getNodeRefWithoutVersion(), HOLD_ONE);
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
* @return
* @return user model and the node ref to be removed from hold
* @throws Exception
*/
@DataProvider (name = "userWithoutPermissionForRemoveFromHold")
@@ -263,7 +263,6 @@ public class RemoveFromHoldsTests extends BaseRMRestTest
STEP("Check node is frozen.");
assertTrue(hasAspect(nodeIdToBeRemoved, FROZEN_ASPECT));
}
@AfterClass (alwaysRun = true)