Item extends DSpaceObject implements DSpaceObjectLegacySupport { void addBundle(Bundle bundle) { bundles.add(bundle); } protected  Item(); boolean isArchived(); boolean isWithdrawn(); boolean isDiscoverable(); Date getLastModified(); void setLastModified(Date lastModified); void setArchived(boolean isArchived); void setDiscoverable(boolean discoverable); void setOwningCollection(Collection c); Collection getOwningCollection(); EPerson getSubmitter(); void setSubmitter(EPerson sub); List<Collection> getCollections(); void clearCollections(); Collection getTemplateItemOf(); List<Bundle> getBundles(); List<Bundle> getBundles(String name); @Override boolean equals(Object obj); @Override int hashCode(); @Override int getType(); @Override String getName(); @Override Integer getLegacyId(); ItemService getItemService(); static final String ANY; }
@Test(expected=AuthorizeException.class) public void testAddBundleNoAuth() throws Exception { new NonStrictExpectations(authorizeService.getClass()) {{ authorizeService.authorizeAction((Context) any, (Item) any, Constants.ADD); result = new AuthorizeException(); }}; String name = "bundle"; Bundle created = bundleService.create(context, it, name); created.setName(context, name); it.addBundle(created); fail("Exception expected"); }