@Test
public void testDeleteBeans() {

    try {
        admin.delete(GRANDFATHER_SCHEMA_NAME, Arrays.asList("g1", "g2"));
    } catch (AbortRuntimeException e) {
        // don't know if schema or instances were invalid from
        // a HTTP 404 response, hence CFG090 and not CFG101/CDG304
        assertThat(e.getEvent().getCode(), is(CFG090));
    }
    admin.create(grandfathersBeans);
    Collection<Bean> beans = admin.list(GRANDFATHER_SCHEMA_NAME);
    assertThat(beans.size(), is(grandfathersBeans.size()));
    admin.delete(GRANDFATHER_SCHEMA_NAME, Arrays.asList("g1", "g2"));
    Optional<Bean> optional = admin.get(BeanId.create("g1", GRANDFATHER_SCHEMA_NAME));
    assertFalse(optional.isPresent());
    optional = admin.get(BeanId.create("g2", GRANDFATHER_SCHEMA_NAME));
    assertFalse(optional.isPresent());
    optional = admin.get(BeanId.create("g3", GRANDFATHER_SCHEMA_NAME));
    assertTrue(optional.isPresent());
}