mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-19 07:53:08 +00:00
DS-4351 Upgrade spring (boot) & hibernate to newer versions
This commit is contained in:
@@ -206,8 +206,6 @@ public class RelationshipServiceImplTest {
|
||||
.isUseForPlaceTrueForRelationshipType(relationship.getRelationshipType(), true)).thenReturn(true);
|
||||
when(authorizeService
|
||||
.authorizeActionBoolean(context, relationship.getLeftItem(), Constants.WRITE)).thenReturn(true);
|
||||
when(authorizeService
|
||||
.authorizeActionBoolean(context, relationship.getRightItem(), Constants.WRITE)).thenReturn(true);
|
||||
when(relationshipService.findByItem(context,leftItem)).thenReturn(leftTypelist);
|
||||
when(relationshipService.findByItem(context,rightItem)).thenReturn(rightTypelist);
|
||||
when(leftEntityType.getLabel()).thenReturn("Entitylabel");
|
||||
@@ -232,8 +230,6 @@ public class RelationshipServiceImplTest {
|
||||
|
||||
@Test
|
||||
public void testDelete() throws Exception {
|
||||
// Mock admin state
|
||||
when(authorizeService.isAdmin(context)).thenReturn(true);
|
||||
|
||||
// Declare objects utilized in unit test
|
||||
MetadataValue metVal = mock(MetadataValue.class);
|
||||
@@ -261,19 +257,10 @@ public class RelationshipServiceImplTest {
|
||||
.thenReturn(true);
|
||||
when(authorizeService.authorizeActionBoolean(context, relationship.getLeftItem(), Constants.WRITE))
|
||||
.thenReturn(true);
|
||||
when(authorizeService.authorizeActionBoolean(context, relationship.getRightItem(), Constants.WRITE))
|
||||
.thenReturn(true);
|
||||
when(relationshipService.findByItem(context,leftItem)).thenReturn(leftTypelist);
|
||||
when(relationshipService.findByItem(context,rightItem)).thenReturn(rightTypelist);
|
||||
when(leftEntityType.getLabel()).thenReturn("Entitylabel");
|
||||
when(rightEntityType.getLabel()).thenReturn("Entitylabel");
|
||||
when(metVal.getValue()).thenReturn("Entitylabel");
|
||||
when(metsList.get(0).getValue()).thenReturn("Entitylabel");
|
||||
when(relationshipService.findByItemAndRelationshipType(context, leftItem, testRel, true))
|
||||
.thenReturn(leftTypelist);
|
||||
when(itemService.getMetadata(leftItem, "relationship", "type", null, Item.ANY)).thenReturn(metsList);
|
||||
when(itemService.getMetadata(rightItem, "relationship", "type", null, Item.ANY)).thenReturn(metsList);
|
||||
when(relationshipDAO.create(any(), any())).thenReturn(relationship);
|
||||
when(relationshipService.find(context,0)).thenReturn(relationship);
|
||||
|
||||
// Invoke delete()
|
||||
@@ -287,7 +274,6 @@ public class RelationshipServiceImplTest {
|
||||
public void testUpdate() throws Exception {
|
||||
// Mock admin state
|
||||
context.turnOffAuthorisationSystem();
|
||||
when(authorizeService.isAdmin(context)).thenReturn(true);
|
||||
|
||||
// Declare objects utilized in unit test
|
||||
MetadataValue metVal = mock(MetadataValue.class);
|
||||
@@ -311,8 +297,6 @@ public class RelationshipServiceImplTest {
|
||||
when(itemService.getMetadata(rightItem, "relationship", "type", null, Item.ANY)).thenReturn(metsList);
|
||||
when(authorizeService.authorizeActionBoolean(context, relationship.getLeftItem(),
|
||||
Constants.WRITE)).thenReturn(true);
|
||||
when(authorizeService.authorizeActionBoolean(context, relationship.getRightItem(),
|
||||
Constants.WRITE)).thenReturn(true);
|
||||
|
||||
// Invoke update()
|
||||
relationshipService.update(context, relationship);
|
||||
|
Reference in New Issue
Block a user