mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 06:53:09 +00:00
77489: Create TiltedRelationshipMetadataServiceIT and override #initPublicationAuthor
This commit is contained in:
@@ -84,7 +84,7 @@ public class RelationshipMetadataServiceIT extends AbstractIntegrationTestWithDa
|
|||||||
* Common function to convert leftItem to a publication item, convert rightItem to an author item,
|
* 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
|
* and relating them to each other stored in the relationship field
|
||||||
*/
|
*/
|
||||||
private void initPublicationAuthor() {
|
protected void initPublicationAuthor() throws Exception {
|
||||||
context.turnOffAuthorisationSystem();
|
context.turnOffAuthorisationSystem();
|
||||||
EntityType publicationEntityType = EntityTypeBuilder.createEntityTypeBuilder(context, "Publication").build();
|
EntityType publicationEntityType = EntityTypeBuilder.createEntityTypeBuilder(context, "Publication").build();
|
||||||
EntityType authorEntityType = EntityTypeBuilder.createEntityTypeBuilder(context, "Author").build();
|
EntityType authorEntityType = EntityTypeBuilder.createEntityTypeBuilder(context, "Author").build();
|
||||||
@@ -152,7 +152,7 @@ public class RelationshipMetadataServiceIT extends AbstractIntegrationTestWithDa
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetAuthorRelationshipMetadata() {
|
public void testGetAuthorRelationshipMetadata() throws Exception {
|
||||||
initPublicationAuthor();
|
initPublicationAuthor();
|
||||||
//leftItem is the publication
|
//leftItem is the publication
|
||||||
//verify the dc.contributor.author virtual metadata
|
//verify the dc.contributor.author virtual metadata
|
||||||
|
@@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user