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

    new NonStrictExpectations(authorizeService.getClass())
    {{
        // Allow Bundle ADD perms
            authorizeService.authorizeAction((Context) any, (Bundle) any,
                Constants.ADD); result = null;
            authorizeService.authorizeAction((Context) any, (Bitstream) any,
                Constants.WRITE); result = null;
    }};
    //default bundle has no bitstreams
    assertThat("testGetBitstreams 0", b.getBitstreams(), notNullValue());
    assertThat("testGetBitstreams 1", b.getBitstreams().size(), equalTo(0));
    //let's add a bitstream
    String name = "name";
    File f = new File(testProps.get("test.bitstream").toString());
    Bitstream bs = bitstreamService.create(context, new FileInputStream(f));
    bs.setName(context, name);
    bundleService.addBitstream(context, b, bs);
    assertThat("testGetBitstreams 2", b.getBitstreams(), notNullValue());
    assertThat("testGetBitstreams 3", b.getBitstreams().size(), equalTo(1));
    assertThat("testGetBitstreams 4", b.getBitstreams().get(0).getName(), equalTo(name));
}