final String objectName = getName();
Map<String, Object> legalCreateAttributes = new HashMap<>();
legalCreateAttributes.put(ConfiguredObject.NAME, objectName);
legalCreateAttributes.put(TestRootCategory.VALID_VALUE, TestRootCategory.VALID_VALUE1);
TestRootCategory object = _model.getObjectFactory().create(TestRootCategory.class, legalCreateAttributes);
assertEquals(TestRootCategory.VALID_VALUE1, object.getValidValue());
object.setAttributes(Collections.singletonMap(TestRootCategory.VALID_VALUE,TestRootCategory.VALID_VALUE2));
assertEquals(TestRootCategory.VALID_VALUE2, object.getValidValue());
try
{
object.setAttributes(Collections.singletonMap(TestRootCategory.VALID_VALUE, "illegal"));
fail("Exception not thrown");
}
catch (IllegalConfigurationException iae)
{
// PASS
}
assertEquals(TestRootCategory.VALID_VALUE2, object.getValidValue());
object.setAttributes(Collections.singletonMap(TestRootCategory.VALID_VALUE,null));
assertNull(object.getValidValue());
}