mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 10:34:25 +00:00
taskid 78099 ItemMetadata caching test
This commit is contained in:
@@ -9,6 +9,7 @@ package org.dspace.content;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@@ -301,15 +302,21 @@ public class RelationshipMetadataServiceIT extends AbstractIntegrationTestWithDa
|
||||
assertThat(authorList.get(0).getMetadataField().getQualifier(), equalTo("author"));
|
||||
assertNull(authorList.get(0).getAuthority());
|
||||
|
||||
//verify there's relation.isPublicationOfAuthor actual metadata
|
||||
assertEquals(1, rightItem.getMetadata().stream()
|
||||
.filter(metadataValue -> metadataValue.getMetadataField().getElement().equals("isPublicationOfAuthor"))
|
||||
.collect(Collectors.toList()).size());
|
||||
assertEquals(1, itemService
|
||||
.getMetadata(rightItem, MetadataSchemaEnum.RELATION.getName(), "isPublicationOfAuthor", null, Item.ANY)
|
||||
.size());
|
||||
|
||||
//verify there's relation.isAuthorOfPublication actual metadata
|
||||
plainRelationshipMetadataList = leftItem.getMetadata().stream()
|
||||
assertEquals(1, leftItem.getMetadata().stream()
|
||||
.filter(metadataValue -> metadataValue.getMetadataField().getElement().equals("isAuthorOfPublication"))
|
||||
.collect(Collectors.toList());
|
||||
assertThat(plainRelationshipMetadataList.size(), equalTo(1));
|
||||
//verify there's relation.isAuthorOfPublication actual metadata
|
||||
List<MetadataValue> relationshipMetadataList = itemService
|
||||
.getMetadata(leftItem, MetadataSchemaEnum.RELATION.getName(), "isAuthorOfPublication", null, Item.ANY);
|
||||
assertThat(relationshipMetadataList.size(), equalTo(1));
|
||||
.collect(Collectors.toList()).size());
|
||||
assertEquals(1, itemService
|
||||
.getMetadata(leftItem, MetadataSchemaEnum.RELATION.getName(), "isAuthorOfPublication", null, Item.ANY)
|
||||
.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user