*/
@Test(enabled=TEST_ENABLED)
public void testDefaultHandlingWithAutoCreate() throws Exception {
FlowPropertyProvider flowPropertyProvider = null;
FlowPropertyDefinitionImpl definition = new FlowPropertyDefinitionImpl("foo");
new FlowTestingUtils().resolveAndInit(definition);
assertFalse(definition.isAutoCreate());
definition.initDefaultObject(Boolean.TRUE);
assertEquals(definition.getDataClass(), Boolean.class);
new FlowTestingUtils().resolveAndInit(definition);
Boolean t = (Boolean) definition.parse(flowPropertyProvider, null);
assertNull(t);
t = (Boolean) definition.getDefaultObject(new Dummy());
assertEquals(t, Boolean.TRUE);
assertTrue(definition.isAutoCreate());
// check behavior if everything is not defined in the Ctor call
// (i.e. like the definition is being defined in the hivemind.xml)
definition = new FlowPropertyDefinitionImpl("foo");
definition.setDefaultObject("true");
definition.setDataClass(Boolean.class);
new FlowTestingUtils().resolveAndInit(definition);
t = (Boolean) definition.parse(flowPropertyProvider, null);
assertNull(t);
t = (Boolean) definition.getDefaultObject(new Dummy());
assertEquals(t, Boolean.TRUE);
assertTrue(definition.isAutoCreate());
final FlowPropertyDefinitionImpl definition1 = new FlowPropertyDefinitionImpl("foo");
definition1.setFlowPropertyValueProvider(new FlowPropertyValueProvider<FlowPropertyProvider>() {
@Override
@SuppressWarnings({ "unchecked" })
public <T> T get(FlowPropertyProvider flowActivity, FlowPropertyDefinition flowPropertyDefinition) {
assertSame(flowPropertyDefinition, definition1);
return (T) Boolean.TRUE;