@Test
void beforeProcessingWithStateVariables() {

  MDC.clear();
  Map<String, String> vars = new HashMap<>();
  vars.put("foo", "bar");
  Map<String, String> stateVariables = spy(vars);
  WorkflowInstance instance = new WorkflowInstance.Builder().setType("type").setId(1).setExternalId("extId")
      .setBusinessKey("businessKey").setStateVariables(stateVariables).build();
  ListenerContext context = new ListenerContext(definition, instance, stateExecution);
  listener.beforeProcessing(context);
  assertThat(MDC.get(LOG_CONTEXT), is(equalTo("type:type, instanceId:1, extId:extId, businessKey:businessKey")));
  verify(stateVariables).entrySet();
}