Skip to content

Commit

Permalink
DSC-1458 fix test to consider virtual metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
abollini committed Feb 6, 2024
1 parent 90bda15 commit b86c0fa
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dspace-api/src/test/java/org/dspace/harvest/OAIHarvesterIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ public void testRunHarvestWithPublicationAndThenPerson() throws Exception {
Item publication = publications.get(0);

List<MetadataValue> values = publication.getMetadata();
assertThat(values, hasSize(19));
assertThat(values, hasSize(21));

assertThat(values, hasItems(with("dc.title", "Test Publication")));
assertThat(values, hasItems(with("dc.type", "Controlled Vocabulary for Resource Type Genres::text")));
Expand All @@ -780,6 +780,8 @@ public void testRunHarvestWithPublicationAndThenPerson() throws Exception {
assertThat(values, hasItems(with("oaire.citation.endPage", "180")));
assertThat(values, hasItems(with("dc.identifier.doi", "10.1007/978-3-642-35233-1_18")));
assertThat(values, hasItems(with("oairecerif.author.affiliation", PLACEHOLDER_PARENT_METADATA_VALUE)));
assertThat(values, hasItems(with("cris.virtual.department", PLACEHOLDER_PARENT_METADATA_VALUE)));
assertThat(values, hasItems(with("cris.virtual.author-orcid", PLACEHOLDER_PARENT_METADATA_VALUE)));
assertThat(values, hasItems(with("cris.sourceId", "test-harvest::3")));
assertThat(values, hasItems(with("dspace.entity.type", "Publication")));

Expand Down Expand Up @@ -859,7 +861,7 @@ public void testRunHarvestWithPersonAndThenPublication() throws Exception {
Item person = findItemByOaiID("oai:test-harvest:Persons/123", personCollection);

List<MetadataValue> values = person.getMetadata();
assertThat(values, hasSize(14));
assertThat(values, hasSize(12));
assertThat(values, hasItems(with("dc.title", "Manghi, Paolo")));
assertThat(values, hasItems(with("cris.sourceId", "test-harvest::123")));
assertThat(values, hasItems(with("dspace.entity.type", "Person")));
Expand All @@ -872,7 +874,7 @@ public void testRunHarvestWithPersonAndThenPublication() throws Exception {

Item publication = findItemByOaiID("oai:test-harvest:Publications/3", collection);
values = publication.getMetadata();
assertThat(values, hasSize(19));
assertThat(values, hasSize(21));

assertThat(values, hasItems(with("dc.title", "Test Publication")));
assertThat(values, hasItems(with("dc.type", "Controlled Vocabulary for Resource Type Genres::text")));
Expand All @@ -885,6 +887,8 @@ public void testRunHarvestWithPersonAndThenPublication() throws Exception {
assertThat(values, hasItems(with("oairecerif.author.affiliation", PLACEHOLDER_PARENT_METADATA_VALUE)));
assertThat(values, hasItems(with("cris.sourceId", "test-harvest::3")));
assertThat(values, hasItems(with("dspace.entity.type", "Publication")));
assertThat(values, hasItems(with("cris.virtual.department", PLACEHOLDER_PARENT_METADATA_VALUE)));
assertThat(values, hasItems(with("cris.virtualsource.department", UUIDUtils.toString(person.getID()))));
assertThat(values, hasItems(with("cris.virtual.author-orcid", "0000-0002-9079-5932")));
assertThat(values, hasItems(with("cris.virtualsource.author-orcid",
UUIDUtils.toString(person.getID()))));
Expand Down

0 comments on commit b86c0fa

Please sign in to comment.