EntityServiceImpl implements EntityService { @Override public List<RelationshipType> getRelationshipTypesByTypeName(Context context, String type) throws SQLException { return getRelationshipTypesByTypeName(context, type, -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 testGetRelationshipTypesByTypeName() throws Exception { List<RelationshipType> list = new ArrayList<>(); RelationshipType relationshipType = mock(RelationshipType.class); list.add(relationshipType); when(relationshipTypeService.findByLeftwardOrRightwardTypeName(context, "leftwardType", -1, -1)) .thenReturn(list); assertEquals("TestGetRelationshipTypesByLabel 0", list, entityService.getRelationshipTypesByTypeName(context, "leftwardType")); }