Source:
public void findAllRelationshipTypesForPublications() throws Exception { context.turnOffAuthorisationSystem(); EntityType publicationEntityType = entityTypeService.findByEntityType(context, "Publication"); EntityType personEntityType = entityTypeService.findByEntityType(context, "Person"); EntityType projectEntityType = entityTypeService.findByEntityType(context, "Project"); EntityType orgunitEntityType = entityTypeService.findByEntityType(context, "OrgUnit"); EntityType journalIssueEntityType = entityTypeService.findByEntityType(context, "journalIssue"); RelationshipType relationshipType1 = relationshipTypeService .findbyTypesAndLabels(context, publicationEntityType, personEntityType, "isAuthorOfPublication", "isPublicationOfAuthor"); RelationshipType relationshipType2 = relationshipTypeService .findbyTypesAndLabels(context, publicationEntityType, projectEntityType, "isProjectOfPublication", "isPublicationOfProject"); RelationshipType relationshipType3 = relationshipTypeService .findbyTypesAndLabels(context, publicationEntityType, orgunitEntityType, "isOrgUnitOfPublication", "isPublicationOfOrgUnit"); RelationshipType relationshipType4 = relationshipTypeService .findbyTypesAndLabels(context, journalIssueEntityType, publicationEntityType, "isPublicationOfJournalIssue", "isJournalIssueOfPublication"); RelationshipType relationshipType5 = relationshipTypeService .findbyTypesAndLabels(context, publicationEntityType, orgunitEntityType, "isAuthorOfPublication", "isPublicationOfAuthor"); getClient().perform(get("/api/core/entitytypes/" + publicationEntityType.getID() + "/relationshiptypes")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.relationshiptypes", containsInAnyOrder( RelationshipTypeMatcher.matchRelationshipTypeEntry(relationshipType1), RelationshipTypeMatcher.matchRelationshipTypeEntry(relationshipType2), RelationshipTypeMatcher.matchRelationshipTypeEntry(relationshipType3), RelationshipTypeMatcher.matchRelationshipTypeEntry(relationshipType4), RelationshipTypeMatcher.matchRelationshipTypeEntry(relationshipType5) ))); }

Target:
public void findAllRelationshipTypesForPublications() throws Exception { EntityType publicationEntityType = entityTypeService.findByEntityType(context, "Publication"); EntityType personEntityType = entityTypeService.findByEntityType(context, "Person"); EntityType projectEntityType = entityTypeService.findByEntityType(context, "Project"); EntityType orgunitEntityType = entityTypeService.findByEntityType(context, "OrgUnit"); EntityType journalIssueEntityType = entityTypeService.findByEntityType(context, "journalIssue"); RelationshipType relationshipType1 = relationshipTypeService .findbyTypesAndLabels(context, publicationEntityType, personEntityType, "isAuthorOfPublication", "isPublicationOfAuthor"); RelationshipType relationshipType2 = relationshipTypeService .findbyTypesAndLabels(context, publicationEntityType, projectEntityType, "isProjectOfPublication", "isPublicationOfProject"); RelationshipType relationshipType3 = relationshipTypeService .findbyTypesAndLabels(context, publicationEntityType, orgunitEntityType, "isOrgUnitOfPublication", "isPublicationOfOrgUnit"); RelationshipType relationshipType4 = relationshipTypeService .findbyTypesAndLabels(context, journalIssueEntityType, publicationEntityType, "isPublicationOfJournalIssue", "isJournalIssueOfPublication"); RelationshipType relationshipType5 = relationshipTypeService .findbyTypesAndLabels(context, publicationEntityType, orgunitEntityType, "isAuthorOfPublication", "isPublicationOfAuthor"); getClient().perform(get("/api/core/entitytypes/" + publicationEntityType.getID() + "/relationshiptypes")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.relationshiptypes", containsInAnyOrder( RelationshipTypeMatcher.matchRelationshipTypeEntry(relationshipType1), RelationshipTypeMatcher.matchRelationshipTypeEntry(relationshipType2), RelationshipTypeMatcher.matchRelationshipTypeEntry(relationshipType3), RelationshipTypeMatcher.matchRelationshipTypeEntry(relationshipType4), RelationshipTypeMatcher.matchRelationshipTypeEntry(relationshipType5) ))); }