@Test
public void testUnsetPrimaryBitstreamID() throws IOException, SQLException, AuthorizeException
{

    new NonStrictExpectations(authorizeService.getClass())
    {
        {
            // Allow Bundle ADD perms
            authorizeService.authorizeAction((Context) any, (Bundle) any,
                    Constants.ADD);
            authorizeService.authorizeAction((Context) any, (Bitstream) any,
                    Constants.WRITE);
            result = null;
    }};
    //set a value different than default
    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);
    //unset
    b.unsetPrimaryBitstreamID();
    //is -1 when not set
    assertThat("testUnsetPrimaryBitstreamID 0", b.getPrimaryBitstream(), equalTo(null));
}