@Test
public void testRemoveLicensesAuth() throws Exception
{

    new NonStrictExpectations(authorizeService.getClass())
    {{
        // Allow Item ADD and REMOVE perms
        authorizeService.authorizeAction((Context) any, (Item) any,
                Constants.ADD); result = null;
        authorizeService.authorizeAction((Context) any, (Item) any,
                Constants.REMOVE); result = null;
        authorizeService.authorizeAction((Context) any, (Item) any,
                Constants.WRITE); result = null;
        authorizeService.authorizeAction(context, (Bitstream) any,
                Constants.DELETE); result = null;
    }};
    String name = "LICENSE";
    Bundle created = bundleService.create(context, it, name);
    created.setName(context, name);
    String bsname = "License";
    File f = new File(testProps.get("test.bitstream").toString());
    Bitstream result = itemService.createSingleBitstream(context, new FileInputStream(f), it, bsname);
    bitstreamService.setFormat(context, result, bitstreamFormatService.findByShortDescription(context, bsname));
    bundleService.addBitstream(context, created, result);
    itemService.removeLicenses(context, it);
    assertThat("testRemoveLicensesAuth 0", itemService.getBundles(it, name), notNullValue());
    assertTrue("testRemoveLicensesAuth 1", itemService.getBundles(it, name).size() == 0);
}