RM-4615: TAS implementation of FilePlanComponentAPI.createElectronicRecord()

This commit is contained in:
Kristijan Conkas
2017-01-25 13:30:29 +00:00
parent 10105b4c21
commit 45fb371de7
4 changed files with 39 additions and 38 deletions

View File

@@ -87,11 +87,12 @@ public class ElectronicRecordTests extends BaseRMRestTest
@Test
(
dataProvider = "invalidParentContainers",
description = "Electronic records can't be created in invalid parent containers"
description = "Electronic records can't be created in invalid parent containers",
expectedExceptions = IllegalArgumentException.class
)
public void cantCreateElectronicRecordsInInvalidContainers(FilePlanComponent container) throws Exception
{
// Build object the filePlan
// Build object the filePlan, this should throw an IllegalArgumentException
getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(createElectronicRecordModel(), IMAGE_FILE, container.getId());
// verify the create request status code
@@ -108,7 +109,11 @@ public class ElectronicRecordTests extends BaseRMRestTest
* </pre>
* @throws Exception
*/
@Test(description = "Electronic record can't be created in closed record folder")
@Test
(
description = "Electronic record can't be created in closed record folder",
expectedExceptions = IllegalArgumentException.class
)
public void cantCreateElectronicRecordInClosedFolder() throws Exception
{
FilePlanComponent recordFolder = createCategoryFolderInFilePlan();
@@ -119,7 +124,7 @@ public class ElectronicRecordTests extends BaseRMRestTest
// close the folder
closeFolder(recordFolder.getId());
// try to create it, this should fail
// try to create it, this should throw IllegalArgumentException
getRestAPIFactory().getFilePlanComponentsAPI().createElectronicRecord(createElectronicRecordModel(), IMAGE_FILE, recordFolder.getId());
// verify the status code