@Test public void testGetLeftRelationshipTypes() throws Exception { Item item = mock(Item.class); Entity entity = mock(Entity.class); EntityType entityType = mock(EntityType.class); RelationshipType relationshipType = mock(RelationshipType.class); List<RelationshipType> relationshipTypeList = new ArrayList<>(); relationshipTypeList.add(relationshipType); List<MetadataValue> metsList = new ArrayList<>(); MetadataValue metadataValue = mock(MetadataValue.class); metsList.add(metadataValue); when(itemService.getMetadata(item, "relationship", "type", null, Item.ANY, false)).thenReturn(metsList); when(entity.getItem()).thenReturn(item); when(entityService.getType(context, entity)).thenReturn(entityType); when(relationshipTypeService.findByEntityType(context, entityService.getType(context, entity), true, -1, -1)) .thenReturn(relationshipTypeList); assertEquals("TestGetLeftRelationshipTypes 0", relationshipTypeList, entityService.getLeftRelationshipTypes(context, entity)); }
@Override public List<RelationshipType> getLeftRelationshipTypes(Context context, Entity entity) throws SQLException { return getLeftRelationshipTypes(context, entity, true, -1, -1); }
EntityServiceImpl implements EntityService { @Override public List<RelationshipType> getLeftRelationshipTypes(Context context, Entity entity) throws SQLException { return getLeftRelationshipTypes(context, entity, true, -1, -1); } }
EntityServiceImpl implements EntityService { @Override public List<RelationshipType> getLeftRelationshipTypes(Context context, Entity entity) throws SQLException { return getLeftRelationshipTypes(context, entity, true, -1, -1); }  }
EntityServiceImpl implements EntityService { @Override public List<RelationshipType> getLeftRelationshipTypes(Context context, Entity entity) throws SQLException { return getLeftRelationshipTypes(context, entity, true, -1, -1); }  @Override Entity findByItemId(Context context, UUID itemId); @Override Entity findByItemId(Context context, UUID itemId, Integer limit, Integer offset); @Override EntityType getType(Context context, Entity entity); @Override List<Relationship> getLeftRelations(Context context, Entity entity); @Override List<Relationship> getRightRelations(Context context, Entity entity); @Override List<Relationship> getRelationsByTypeName(Context context, String typeName); @Override List<Relationship> getRelationsByTypeName(Context context, String typeName, Integer limit, Integer offset); @Override List<RelationshipType> getAllRelationshipTypes(Context context, Entity entity); @Override List<RelationshipType> getAllRelationshipTypes(Context context, Entity entity, Integer limit, Integer offset); @Override List<RelationshipType> getLeftRelationshipTypes(Context context, Entity entity); @Override List<RelationshipType> getLeftRelationshipTypes(Context context, Entity entity, boolean isLeft,
                                                           Integer limit, Integer offset); @Override List<RelationshipType> getRightRelationshipTypes(Context context, Entity entity); @Override List<RelationshipType> getRightRelationshipTypes(Context context, Entity entity, boolean isLeft,
                                                            Integer limit, Integer offset); @Override List<RelationshipType> getRelationshipTypesByTypeName(Context context, String type); @Override List<RelationshipType> getRelationshipTypesByTypeName(Context context, String typeName,
                                                                 Integer limit, Integer offset); }
EntityServiceImpl implements EntityService { @Override public List<RelationshipType> getLeftRelationshipTypes(Context context, Entity entity) throws SQLException { return getLeftRelationshipTypes(context, entity, true, -1, -1); }  @Override Entity findByItemId(Context context, UUID itemId); @Override Entity findByItemId(Context context, UUID itemId, Integer limit, Integer offset); @Override EntityType getType(Context context, Entity entity); @Override List<Relationship> getLeftRelations(Context context, Entity entity); @Override List<Relationship> getRightRelations(Context context, Entity entity); @Override List<Relationship> getRelationsByTypeName(Context context, String typeName); @Override List<Relationship> getRelationsByTypeName(Context context, String typeName, Integer limit, Integer offset); @Override List<RelationshipType> getAllRelationshipTypes(Context context, Entity entity); @Override List<RelationshipType> getAllRelationshipTypes(Context context, Entity entity, Integer limit, Integer offset); @Override List<RelationshipType> getLeftRelationshipTypes(Context context, Entity entity); @Override List<RelationshipType> getLeftRelationshipTypes(Context context, Entity entity, boolean isLeft,
                                                           Integer limit, Integer offset); @Override List<RelationshipType> getRightRelationshipTypes(Context context, Entity entity); @Override List<RelationshipType> getRightRelationshipTypes(Context context, Entity entity, boolean isLeft,
                                                            Integer limit, Integer offset); @Override List<RelationshipType> getRelationshipTypesByTypeName(Context context, String type); @Override List<RelationshipType> getRelationshipTypesByTypeName(Context context, String typeName,
                                                                 Integer limit, Integer offset);  }