@Test
public void testDeleteBean() {

    BeanId id = BeanId.create("g1", GRANDFATHER_SCHEMA_NAME);
    try {
        admin.delete(id);
    } 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(toBean(g1));
    Optional<Bean> optional = admin.get(id);
    assertTrue(optional.isPresent());
    admin.delete(id);
    optional = admin.get(id);
    assertFalse(optional.isPresent());
}