MDerSchema actual = derSchemaDAO.find("sderived", MDerSchema.class);
assertNotNull("expected save to work", actual);
assertEquals(sderived, actual);
Membership owner = membershipDAO.find(4L);
assertNotNull("did not get expected membership", owner);
MDerAttrTemplate template = new MDerAttrTemplate();
template.setSchema(sderived);
owner.getSyncopeRole().getAttrTemplates(MDerAttrTemplate.class).add(template);
MDerAttr derAttr = new MDerAttr();
derAttr.setOwner(owner);
derAttr.setTemplate(owner.getSyncopeRole().getAttrTemplate(MDerAttrTemplate.class, sderived.getName()));
derAttr = derAttrDAO.save(derAttr);
assertNotNull(derAttr.getTemplate());
derAttrDAO.flush();
derAttr = derAttrDAO.find(derAttr.getId(), MDerAttr.class);
assertNotNull("expected save to work", derAttr);
String value = derAttr.getValue(owner.getAttrs());
assertNotNull(value);
assertFalse(value.isEmpty());
assertTrue(value.equalsIgnoreCase("4"));
}