new FlowPropertyDefinitionImpl(opaqueSecondFlowProperty, String.class).initPropertyScope(flowLocal).initPropertyUsage(PropertyUsage.io)
);
flowTestingUtils.addFlowDefinition("second", flowActivity2);
FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
FlowStateImplementor flowState = flowManagement.startFlowState("first", true, FlowUtils.INSTANCE.createState(privatePropertyForSecondFlow, globalSettingForSecondFlowPrivateProperty,
initializedByFirst, "ShouldBeIgnored"), false);
String opaqueValuePassedFromFirstToSecond = "opaque";
flowState.setRawProperty(opaqueSecondFlowProperty, opaqueValuePassedFromFirstToSecond);
assertEquals(flowState.getProperty(initializedByFirst, String.class), null, "flowState="+flowState);
String propertyValueInitializedByFirst = "realvalue";
flowState.setProperty(initializedByFirst, propertyValueInitializedByFirst);
flowTestingUtils.advanceToEnd(flowState);
FlowStateImplementor nextFlowState = flowManagement.getCurrentFlowState();
assertNotNull(nextFlowState);
// flowLocal namespace ignored the passed setting
assertNull(nextFlowState.getProperty(privatePropertyForSecondFlow, Boolean.class), "nextFlowState="+nextFlowState);
String privatePropertyValueInSecondFlow = "true";
nextFlowState.setProperty(privatePropertyForSecondFlow, privatePropertyValueInSecondFlow);
assertEquals(nextFlowState.getFlowTypeName(), "second");
// but it is still there for others.
assertEquals(nextFlowState.getRawProperty((String)null, privatePropertyForSecondFlow), globalSettingForSecondFlowPrivateProperty, "nextFlowState="+nextFlowState);
assertEquals(nextFlowState.getProperty(opaqueSecondFlowProperty, String.class), opaqueValuePassedFromFirstToSecond, "looking at="+opaqueSecondFlowProperty+" nextFlowState="+nextFlowState);
assertEquals(nextFlowState.getProperty(privatePropertyForSecondFlow), Boolean.parseBoolean(privatePropertyValueInSecondFlow), "looking at="+privatePropertyForSecondFlow+ " nextFlowState="+nextFlowState);
assertEquals(nextFlowState.getRawProperty((String)null, initializedByFirst), propertyValueInitializedByFirst, "nextFlowState="+nextFlowState);
flowTestingUtils.advanceToEnd(flowState);
}