mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-4550: fixed indentation
This commit is contained in:
@@ -131,34 +131,34 @@ public class DeclareDocumentAsRecordTests extends BaseRMRestTest
|
|||||||
.stream()
|
.stream()
|
||||||
.filter(f -> f.getFilePlanComponentModel().getId().equals(document.getNodeRefWithoutVersion()))
|
.filter(f -> f.getFilePlanComponentModel().getId().equals(document.getNodeRefWithoutVersion()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
assertEquals(filesAfterRename.size(), 1, "There should be only one file in folder " + testFolder.getName());
|
assertEquals(filesAfterRename.size(), 1, "There should be only one file in folder " + testFolder.getName());
|
||||||
|
|
||||||
// verify the new name has the form of "<original name> (<record Id>).<original extension>"
|
// verify the new name has the form of "<original name> (<record Id>).<original extension>"
|
||||||
assertEquals(filesAfterRename.get(0).getFilePlanComponentModel().getName(),
|
assertEquals(filesAfterRename.get(0).getFilePlanComponentModel().getName(),
|
||||||
document.getName().replace(".", String.format(" (%s).", record.getProperties().getRecordId())));
|
document.getName().replace(".", String.format(" (%s).", record.getProperties().getRecordId())));
|
||||||
|
|
||||||
// verify the document in collaboration site is now a record, note the file is now renamed hence folder + doc. name concatenation
|
// verify the document in collaboration site is now a record, note the file is now renamed hence folder + doc. name concatenation
|
||||||
// this also verifies the document is still in the initial folder
|
// this also verifies the document is still in the initial folder
|
||||||
Document documentPostFiling = dataContent.usingSite(testSite)
|
Document documentPostFiling = dataContent.usingSite(testSite)
|
||||||
.usingUser(testUser)
|
.usingUser(testUser)
|
||||||
.getCMISDocument(testFolder.getCmisLocation() + "/" + filesAfterRename.get(0).getFilePlanComponentModel().getName());
|
.getCMISDocument(testFolder.getCmisLocation() + "/" + filesAfterRename.get(0).getFilePlanComponentModel().getName());
|
||||||
|
|
||||||
// a document is a record if "Record" is one of its secondary types
|
// a document is a record if "Record" is one of its secondary types
|
||||||
List<SecondaryType> documentSecondary = documentPostFiling.getSecondaryTypes()
|
List<SecondaryType> documentSecondary = documentPostFiling.getSecondaryTypes()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(t -> t.getDisplayName().equals("Record"))
|
.filter(t -> t.getDisplayName().equals("Record"))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
assertFalse(documentSecondary.isEmpty(), "Document is not a record");
|
assertFalse(documentSecondary.isEmpty(), "Document is not a record");
|
||||||
|
|
||||||
// verify the document is readable and has same content as corresponding record
|
// verify the document is readable and has same content as corresponding record
|
||||||
try
|
try
|
||||||
(
|
(
|
||||||
InputStream recordInputStream = getRestAPIFactory().getRecordsAPI().getRecordContent(record.getId()).asInputStream();
|
InputStream recordInputStream = getRestAPIFactory().getRecordsAPI().getRecordContent(record.getId()).asInputStream();
|
||||||
InputStream documentInputStream = documentPostFiling.getContentStream().getStream();
|
InputStream documentInputStream = documentPostFiling.getContentStream().getStream();
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assertEquals(DigestUtils.sha1(recordInputStream), DigestUtils.sha1(documentInputStream));
|
assertEquals(DigestUtils.sha1(recordInputStream), DigestUtils.sha1(documentInputStream));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user