RM-4023: better check for PUT request

This commit is contained in:
Kristijan Conkas
2016-11-15 17:12:00 +00:00
parent b78970484e
commit d991e65d6c

View File

@@ -246,7 +246,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
* *
* @throws Exception * @throws Exception
*/ */
@Test(description = "Child unfiled records folder can be created in a parent unfiled records folder") @Test(description = "Unfiled record folder")
public void editUnfiledRecordsFolder() throws Exception public void editUnfiledRecordsFolder() throws Exception
{ {
RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
@@ -267,12 +267,13 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
.getJson(); .getJson();
// Update the unfiled records folder // Update the unfiled records folder
FilePlanComponent renamedFolder = filePlanComponentAPI.updateFilePlanComponent(updateFolderProperties, filePlanComponentAPI.updateFilePlanComponent(updateFolderProperties, folderToModify.getId());
folderToModify.getId());
// Verify the status code // Verify the status code
restWrapper.assertStatusCodeIs(OK); restWrapper.assertStatusCodeIs(OK);
// this is to ensure the change was actually applied, rather than simply trusting the object returned by PUT
FilePlanComponent renamedFolder = filePlanComponentAPI.getFilePlanComponent(folderToModify.getId());
// Verify the returned file plan component // Verify the returned file plan component
assertEquals(modified + folderToModify.getName(), renamedFolder.getName()); assertEquals(modified + folderToModify.getName(), renamedFolder.getName());
assertEquals(modified + folderToModify.getProperties().getTitle(), renamedFolder.getProperties().getTitle()); assertEquals(modified + folderToModify.getProperties().getTitle(), renamedFolder.getProperties().getTitle());