### Question:
TokenFlowExecutor implements FlowExecutor { @Override public void trigger(final TriggerContext trigger) { log.debug("triggering {}", trigger); if (trigger.getInstanceId() == null) { throw new IllegalArgumentException("instance not specified for trigger"); } final FlowNodeDefinition node = getNode(trigger.getDefinitionId(), trigger.getNodeId()); FlowInstance flowInstance = instanceStore .findInstance(new InstanceSelector().withInstanceId(trigger.getInstanceId())) .get(); final FlowNodeExecutor<FlowNodeDefinition> nodeExecutor = getNodeExecutor(node); final ExecutionContext executionContext = executionContextFactory.createExecutionContext(flowInstance, trigger); FlowNodeExecutionResult executionResult = executeWithListeners(trigger, new Callable<FlowNodeExecutionResult>() { @Override public FlowNodeExecutionResult call() throws Exception { FlowNodeExecutionResult executionResult = nodeExecutor.execute(node, executionContext); storeProperties(trigger, trigger.getInstanceId()); return executionResult; } }); triggerNextOnSuccess(trigger, node, executionResult); } TokenFlowExecutor(TokenStore tokenStore,
                           InstanceStore instanceStore,
                           DefinitionStore definitionStore,
                           PropertyStore propertyStore,
                           ListenerManager listenerManager,
                           Registry registry,
                           ExpressionEvaluator expressionEvaluator,
                           AsyncTriggerStore asyncTriggerStore,
                           AsyncTriggerScheduler asyncTriggerScheduler,
                           CallDefinitionExecutor callDefinitionExecutor,
                           ScriptExecutor scriptExecutor); @Override FlowInstance startFlow(TriggerContext trigger); @Override void trigger(final TriggerContext trigger); void setTokenStore(TokenStore tokenStore); void setTokenOperations(TokenOperations tokenOperations); void setDefinitionStore(DefinitionStore definitionStore); void setPropertyStore(PropertyStore propertyStore); void setListenerManager(ListenerManager listenerManager); void setRegistry(Registry registry); void setExpressionEvaluator(ExpressionEvaluator expressionEvaluator); void setAsyncTriggerStore(AsyncTriggerStore asyncTriggerStore); void setAsyncTriggerScheduler(AsyncTriggerScheduler asyncTriggerScheduler); void setCallDefinitionExecutor(CallDefinitionExecutor callDefinitionExecutor);  }### Answer:
@Test public void shouldStorePropertiesOnTrigger() { FlowBuilder flow = propertyFlow(); when(definitionStore.findById(flow.getDefinition().getId())).thenReturn(flow.getDefinition()); Identifier<?> instanceId = id("instance"); givenInstance(instanceId); Trigger property = new Trigger() .instanceId(instanceId) .nodeId(IdUtil.id("start")) .definitionId(flow.getId()) .property("key", "value"); context.trigger(property); verify(propertyStore, times(2)).setProperty(eq(instanceId), any(FlowInstanceProperty.class)); }