Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport { public boolean isDeleted() throws SQLException { return deleted; } protected  Bitstream(); int getSequenceID(); void setSequenceID(int sid); @Override String getName(); void setName(Context context, String n); String getSource(); void setSource(Context context, String n); String getDescription(); void setDescription(Context context, String n); String getChecksum(); void setChecksum(String checksum); String getChecksumAlgorithm(); void setChecksumAlgorithm(String checksumAlgorithm); long getSize(); void setSizeBytes(long sizeBytes); String getUserFormatDescription(); BitstreamFormat getFormat(Context context); boolean isDeleted(); void setDeleted(boolean deleted); List<Bundle> getBundles(); @Override int getType(); Collection getCollection(); Community getCommunity(); int getStoreNumber(); void setStoreNumber(int storeNumber); String getInternalId(); void setInternalId(String internalId); void setUserFormatDescription(Context context, String desc); String getFormatDescription(Context context); void setFormat(Context context, BitstreamFormat f); @Override Integer getLegacyId(); @Override boolean equals(Object other); @Override int hashCode();  }
@Test public void testDeleteAndExpunge() throws IOException, SQLException, AuthorizeException { new NonStrictExpectations(authorizeService.getClass()) {{ authorizeService.authorizeAction((Context) any, (Bitstream) any, Constants.WRITE); result = null; authorizeService.authorizeAction((Context) any, (Bitstream) any, Constants.DELETE); result = null; }}; File f = new File(testProps.get("test.bitstream").toString()); Bitstream delBS = bitstreamService.create(context, new FileInputStream(f)); UUID bitstreamId = delBS.getID(); assertFalse("testIsDeleted 0", delBS.isDeleted()); bitstreamService.delete(context, delBS); assertTrue("testDelete 0", delBS.isDeleted()); bitstreamService.expunge(context, delBS); assertThat("testExpunge 0", bitstreamService.find(context, bitstreamId), nullValue()); }