### Question:
Bitstream extends DSpaceObject { public void update() throws SQLException, AuthorizeException { AuthorizeManager.authorizeAction(bContext, this, Constants.WRITE); log.info(LogManager.getHeader(bContext, "update_bitstream", "bitstream_id=" + getID())); if (modified) { bContext.addEvent(new Event(Event.MODIFY, Constants.BITSTREAM, getID(), null)); modified = false; } if (modifiedMetadata) { bContext.addEvent(new Event(Event.MODIFY_METADATA, Constants.BITSTREAM, getID(), getDetails())); modifiedMetadata = false; clearDetails(); } DatabaseManager.update(bContext, bRow); } Bitstream(Context context, TableRow row); static Bitstream find(Context context, int id); static Bitstream[] findAll(Context context); int getID(); String getHandle(); int getSequenceID(); void setSequenceID(int sid); String getName(); void setName(String n); String getSource(); void setSource(String n); String getDescription(); void setDescription(String n); String getChecksum(); String getChecksumAlgorithm(); long getSize(); void setUserFormatDescription(String desc); String getUserFormatDescription(); String getFormatDescription(); BitstreamFormat getFormat(); void setFormat(BitstreamFormat f); void update(); InputStream retrieve(); Bundle[] getBundles(); int getType(); boolean isRegisteredBitstream(); int getStoreNumber(); DSpaceObject getParentObject();  }### Answer:
@Test(expected=AuthorizeException.class) public void testUpdateNotAdmin() throws SQLException, AuthorizeException { new NonStrictExpectations() { AuthorizeManager authManager; { AuthorizeManager.authorizeAction((Context) any, (Bitstream) any, Constants.WRITE); result = new AuthorizeException(); } }; bs.update(); }
@Test public void testUpdateAdmin() throws SQLException, AuthorizeException { new NonStrictExpectations() { AuthorizeManager authManager; { AuthorizeManager.authorizeAction((Context) any, (Bitstream) any, Constants.WRITE); result = null; } }; bs.update(); }