EntityServiceImpl implements EntityService { @Override public List<Relationship> getRelationsByTypeName(Context context, String typeName) throws SQLException { return getRelationsByTypeName(context, typeName, -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);  }
@Test public void testGetRelationsByTypeName() throws Exception { Relationship relationship = mock(Relationship.class); RelationshipType relationshipType = mock(RelationshipType.class); relationship.setRelationshipType(relationshipType); List<Relationship> relationshipList = new ArrayList<>(); relationshipList.add(relationship); when(relationshipService.findByTypeName(context, "leftwardType", -1, -1)).thenReturn(relationshipList); assertEquals("TestGetRelationsByLabel 0", relationshipList, entityService.getRelationsByTypeName(context, "leftwardType")); }