Bundle extends DSpaceObject implements DSpaceObjectLegacySupport { public void setPrimaryBitstreamID(Bitstream bitstream) { primaryBitstream = bitstream; setModified(); } protected  Bundle(); @Override Integer getLegacyId(); @Override String getName(); void setName(Context context, String name); Bitstream getPrimaryBitstream(); void setPrimaryBitstreamID(Bitstream bitstream); void unsetPrimaryBitstreamID(); List<Bitstream> getBitstreams(); void clearBitstreams(); void removeBitstream(Bitstream bitstream); List<Item> getItems(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int getType();  }
@Test public void testSetPrimaryBitstreamID() throws SQLException, AuthorizeException, IOException { new NonStrictExpectations(authorizeService.getClass()) { { authorizeService.authorizeAction((Context) any, (Bundle) any, Constants.ADD); authorizeService.authorizeAction((Context) any, (Bitstream) any, Constants.WRITE); result = null; }}; File f = new File(testProps.get("test.bitstream").toString()); Bitstream bs = bitstreamService.create(context, new FileInputStream(f)); bundleService.addBitstream(context, b, bs); b.setPrimaryBitstreamID(bs); assertThat("testSetPrimaryBitstreamID 0", b.getPrimaryBitstream(), equalTo(bs)); }