Assert.assertNotNull(feature);
}
@Test
public void testExistingOneInMany() throws Exception {
NestedOneInMany oneInMany1 = new NestedOneInMany();
oneInMany1.setTextAttr("existing1");
factory.getCurrentSession().save(oneInMany1);
factory.getCurrentSession().flush();
Object o = featureModel.newInstance();
Map<String, Attribute> attributes = new HashMap<String, Attribute>();
// create many attribute
OneToManyAttribute many = new OneToManyAttribute(new ArrayList<AssociationValue>());
// create empty and add
AssociationValue many1 = new AssociationValue(null, new HashMap<String, Attribute<?>>(), false);
many.getValue().add(many1);
// create an existing one-in-many and add
ManyToOneAttribute oneInMany2 = new ManyToOneAttribute();
AssociationValue oneInManyValue = new AssociationValue(new LongAttribute(oneInMany1.getId()), new HashMap<String, Attribute<?>>(), false);
oneInMany2.setValue(oneInManyValue);
AssociationValue many2 = new AssociationValue(null, new HashMap<String, Attribute<?>>(), false);
many2.getAllAttributes().put("oneInMany", oneInMany2);
many.getValue().add(many2);
// add many