try to fix diff indentation

This commit is contained in:
Rodica Sutu
2017-01-26 17:50:47 +02:00
parent aea517f0f7
commit e0f29cfaa2

View File

@@ -257,32 +257,40 @@ public class ElectronicRecordTests extends BaseRMRestTest
* Given I want to create an electronic record * Given I want to create an electronic record
* When I use the path relative to the filePlanComponentid * When I use the path relative to the filePlanComponentid
* Then the containers in the relativePath that don't exist are created before creating the electronic record * Then the containers in the relativePath that don't exist are created before creating the electronic record
*/ */
public void createElectronicRecordWithRelativePath() throws Exception public void createElectronicRecordWithRelativePath() throws Exception
{ {
//the containers specified on the RELATIVE_PATH parameter don't exist on server //the containers specified on the RELATIVE_PATH parameter don't exist on server
String RELATIVE_PATH = CATEGORY_NAME + "/"+ CATEGORY_NAME +"/"+ FOLDER_NAME; String RELATIVE_PATH = CATEGORY_NAME + "/" + CATEGORY_NAME + "/" + FOLDER_NAME;
FilePlanComponent electronicRecord = FilePlanComponent.builder() FilePlanComponent electronicRecord = FilePlanComponent.builder()
.name(ELECTRONIC_RECORD_NAME) .name(ELECTRONIC_RECORD_NAME)
.nodeType(CONTENT_TYPE.toString()) .nodeType(CONTENT_TYPE.toString())
.content(FilePlanComponentContent.builder().mimeType("text/plain").build()) .content(FilePlanComponentContent
.properties(FilePlanComponentProperties.builder().description("Description").build()) .builder()
.mimeType("text/plain")
.build()
)
.properties(FilePlanComponentProperties
.builder()
.description("Description")
.build()
)
.relativePath(RELATIVE_PATH) .relativePath(RELATIVE_PATH)
.build(); .build();
FilePlanComponentAPI filePlanComponentsAPI = getRestAPIFactory().getFilePlanComponentsAPI(); FilePlanComponentAPI filePlanComponentsAPI = getRestAPIFactory().getFilePlanComponentsAPI();
FilePlanComponent recordCreated = filePlanComponentsAPI.createElectronicRecord(electronicRecord, FilePlanComponent recordCreated = filePlanComponentsAPI.createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), FILE_PLAN_ALIAS
createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), FILE_PLAN_ALIAS); );
// verify the create request status code // verify the create request status code
assertStatusCode(CREATED); assertStatusCode(CREATED);
// get newly created electronic record and verify its properties // get newly created electronic record and verify its properties
assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getId()).getName().startsWith(ELECTRONIC_RECORD_NAME)); assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getId())
assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getParentId()).getName().equals(FOLDER_NAME)); .getName().startsWith(ELECTRONIC_RECORD_NAME));
assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getParentId())
.getName().equals(FOLDER_NAME));
//get newly created electronic record using the relativePath //get newly created electronic record using the relativePath
assertTrue(filePlanComponentsAPI.getFilePlanComponent(FILE_PLAN_ALIAS, assertTrue(filePlanComponentsAPI.getFilePlanComponent(FILE_PLAN_ALIAS, FilePlanComponentFields.RELATIVE_PATH + "=" + RELATIVE_PATH + "/" + recordCreated.getName())
FilePlanComponentFields.RELATIVE_PATH + "=" + RELATIVE_PATH + "/" + recordCreated.getName())
.getId().equals(recordCreated.getId())); .getId().equals(recordCreated.getId()));
//the category specified via the RELATIVE_PATH exist, folder doesn't exist //the category specified via the RELATIVE_PATH exist, folder doesn't exist
@@ -292,38 +300,40 @@ public class ElectronicRecordTests extends BaseRMRestTest
// verify the create request status code // verify the create request status code
assertStatusCode(CREATED); assertStatusCode(CREATED);
// get newly created electronic record and verify its properties // get newly created electronic record and verify its properties
assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getId()).getName().startsWith(ELECTRONIC_RECORD_NAME)); assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getId())
assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getParentId()).getName().startsWith(FOLDER_NAME)); .getName().startsWith(ELECTRONIC_RECORD_NAME));
assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getParentId())
.getName().startsWith(FOLDER_NAME));
//get newly created electronic record using the relativePath //get newly created electronic record using the relativePath
assertTrue(filePlanComponentsAPI.getFilePlanComponent(FILE_PLAN_ALIAS, assertTrue(filePlanComponentsAPI.getFilePlanComponent(FILE_PLAN_ALIAS, FilePlanComponentFields.RELATIVE_PATH + "=" + RELATIVE_PATH + "/" + recordCreated.getName())
FilePlanComponentFields.RELATIVE_PATH+"="+RELATIVE_PATH+"/"+recordCreated.getName())
.getId().equals(recordCreated.getId())); .getId().equals(recordCreated.getId()));
//the containers from the RELATIVE PATH exists //the containers from the RELATIVE PATH exists
electronicRecord.setName(ELECTRONIC_RECORD_NAME + getRandomAlphanumeric()); electronicRecord.setName(ELECTRONIC_RECORD_NAME + getRandomAlphanumeric());
recordCreated = filePlanComponentsAPI.createElectronicRecord(electronicRecord, recordCreated = filePlanComponentsAPI.createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), FILE_PLAN_ALIAS);
createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME),
FILE_PLAN_ALIAS);
// verify the create request status code // verify the create request status code
assertStatusCode(CREATED); assertStatusCode(CREATED);
// get newly created electronic record and verify its properties // get newly created electronic record and verify its properties
assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getId()).getName().startsWith(ELECTRONIC_RECORD_NAME)); assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getId())
assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getParentId()).getName().startsWith(FOLDER_NAME)); .getName().startsWith(ELECTRONIC_RECORD_NAME));
assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getParentId())
.getName().startsWith(FOLDER_NAME));
//get newly created electronic record using the relativePath //get newly created electronic record using the relativePath
assertTrue(filePlanComponentsAPI.getFilePlanComponent(FILE_PLAN_ALIAS, FilePlanComponentFields.RELATIVE_PATH + "=" + RELATIVE_PATH + "/" + recordCreated.getName()) assertTrue(filePlanComponentsAPI.getFilePlanComponent(FILE_PLAN_ALIAS, FilePlanComponentFields.RELATIVE_PATH + "=" + RELATIVE_PATH + "/" + recordCreated.getName())
.getId().equals(recordCreated.getId())); .getId().equals(recordCreated.getId()));
//create the container structure relative to the categoryId //create the container structure relative to the categoryId
String categoryId = filePlanComponentsAPI.getFilePlanComponent(FILE_PLAN_ALIAS, FilePlanComponentFields.RELATIVE_PATH + "="+CATEGORY_NAME) String categoryId = filePlanComponentsAPI.getFilePlanComponent(FILE_PLAN_ALIAS, FilePlanComponentFields.RELATIVE_PATH + "=" + CATEGORY_NAME)
.getId(); .getId();
RELATIVE_PATH = CATEGORY_NAME+ CATEGORY_NAME+"/"+FOLDER_NAME; RELATIVE_PATH = CATEGORY_NAME + CATEGORY_NAME + "/" + FOLDER_NAME;
electronicRecord.setRelativePath(RELATIVE_PATH); electronicRecord.setRelativePath(RELATIVE_PATH);
recordCreated = filePlanComponentsAPI.createElectronicRecord(electronicRecord, recordCreated = filePlanComponentsAPI.createElectronicRecord(electronicRecord, createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME), categoryId);
createTempFile(ELECTRONIC_RECORD_NAME, ELECTRONIC_RECORD_NAME),categoryId);
// verify the create request status code // verify the create request status code
assertStatusCode(CREATED); assertStatusCode(CREATED);
// get newly created electronic record and verify its properties // get newly created electronic record and verify its properties
assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getId()).getName().startsWith(ELECTRONIC_RECORD_NAME)); assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getId())
assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getParentId()).getName().startsWith(FOLDER_NAME)); .getName().startsWith(ELECTRONIC_RECORD_NAME));
assertTrue(filePlanComponentsAPI.getFilePlanComponent(recordCreated.getParentId())
.getName().startsWith(FOLDER_NAME));
} }
} }