// when i set a variable
caseService.withCaseExecution(taskExecution.getId()).setVariableLocal("testVariable", "value1").execute();
// then the listener is invoked
assertEquals(1, LogExecutionContextListener.getCaseExecutionContexts().size());
CaseExecutionContext executionContext = LogExecutionContextListener.getCaseExecutionContexts().get(0);
assertNotNull(executionContext);
// although this is not inside a command, checking for IDs should be ok
assertEquals(caseInstance.getId(), executionContext.getCaseInstance().getId());
assertEquals(taskExecution.getId(), executionContext.getExecution().getId());
LogExecutionContextListener.reset();
}