@Test
public void testMergeBean() {

    try {
        admin.merge(Bean.create(BeanId.create("bogus", "bogus")));
    } 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));
    }
    Grandfather g1 = getGrandfather("g1");
    Bean bg1 = toBean(g1);
    admin.create(bg1);
    // merge in a single property
    g1 = new Grandfather("g1");
    bg1 = toBean(g1);
    bg1.setProperty("prop1", "testMergeBean");
    admin.merge(bg1);
    Optional<Bean> optional = admin.get(bg1.getId());
    assertTrue(optional.isPresent());
    // assert new value
    String value = optional.get().getSingleValue("prop1");
    assertThat(value, is("testMergeBean"));
    // assert that other values are untouched
    assertNotNull(optional.get().getSingleValue("prop9"));
    assertNotNull(optional.get().getSingleValue("prop2"));
}