DS-4351 Upgrade spring (boot) & hibernate to newer versions

This commit is contained in:
Samuel
2019-10-25 18:21:49 +02:00
parent 4b92af8239
commit e2c353d75e
42 changed files with 281 additions and 408 deletions

View File

@@ -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);