EntityServiceImpl implements EntityService { @Override public Entity findByItemId(Context context, UUID itemId) throws SQLException { return findByItemId(context, itemId, -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 testfindByItemId() throws Exception { Item item = mock(Item.class); Relationship relationship = mock(Relationship.class); relationship.setId(9); when(itemService.find(any(), any())).thenReturn(item); when(item.getName()).thenReturn("ItemName"); assertEquals("TestFindByItem 0", "ItemName", entityService.findByItemId(context, item.getID()).getItem().getName()); }