diff --git a/dspace-api/src/test/java/org/dspace/content/RelationshipMetadataServiceIT.java b/dspace-api/src/test/java/org/dspace/content/RelationshipMetadataServiceIT.java index ab1d8cfc97..eb01f0f7e0 100644 --- a/dspace-api/src/test/java/org/dspace/content/RelationshipMetadataServiceIT.java +++ b/dspace-api/src/test/java/org/dspace/content/RelationshipMetadataServiceIT.java @@ -84,7 +84,7 @@ public class RelationshipMetadataServiceIT extends AbstractIntegrationTestWithDa * Common function to convert leftItem to a publication item, convert rightItem to an author item, * and relating them to each other stored in the relationship field */ - private void initPublicationAuthor() { + protected void initPublicationAuthor() throws Exception { context.turnOffAuthorisationSystem(); EntityType publicationEntityType = EntityTypeBuilder.createEntityTypeBuilder(context, "Publication").build(); EntityType authorEntityType = EntityTypeBuilder.createEntityTypeBuilder(context, "Author").build(); @@ -152,7 +152,7 @@ public class RelationshipMetadataServiceIT extends AbstractIntegrationTestWithDa } @Test - public void testGetAuthorRelationshipMetadata() { + public void testGetAuthorRelationshipMetadata() throws Exception { initPublicationAuthor(); //leftItem is the publication //verify the dc.contributor.author virtual metadata diff --git a/dspace-api/src/test/java/org/dspace/content/TiltedRelationshipMetadataServiceIT.java b/dspace-api/src/test/java/org/dspace/content/TiltedRelationshipMetadataServiceIT.java new file mode 100644 index 0000000000..4c68e4be11 --- /dev/null +++ b/dspace-api/src/test/java/org/dspace/content/TiltedRelationshipMetadataServiceIT.java @@ -0,0 +1,30 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +package org.dspace.content; + +/** + * This class carries out the same test cases as {@link RelationshipMetadataServiceIT} with a few modifications. + */ +public class TiltedRelationshipMetadataServiceIT extends RelationshipMetadataServiceIT { + + /** + * Call parent implementation and set the tilted property of {@link #isAuthorOfPublicationRelationshipType}. + */ + @Override + protected void initPublicationAuthor() throws Exception { + super.initPublicationAuthor(); + + context.turnOffAuthorisationSystem(); + + isAuthorOfPublicationRelationshipType.setTilted(RelationshipType.Tilted.LEFT); + relationshipTypeService.update(context, isAuthorOfPublicationRelationshipType); + + context.restoreAuthSystemState(); + } + +}