}
@Test
@Deployment(resources = "org/camunda/bpm/engine/cdi/test/api/BusinessProcessBeanTest.test.bpmn20.xml")
public void testGetVariableCache() {
BusinessProcess businessProcess = getBeanInstance(BusinessProcess.class);
// initially the variable cache is empty
assertEquals(Collections.EMPTY_MAP, businessProcess.getVariableCache());
// set a variable
businessProcess.setVariable("aVariableName", "aVariableValue");
// now the variable is set
assertEquals(Collections.singletonMap("aVariableName", "aVariableValue"), businessProcess.getVariableCache());
// getting the variable cache does not empty it:
assertEquals(Collections.singletonMap("aVariableName", "aVariableValue"), businessProcess.getVariableCache());
businessProcess.startProcessByKey("businessProcessBeanTest");
// now the variable cache is empty again:
assertEquals(Collections.EMPTY_MAP, businessProcess.getVariableCache());
// set a variable
businessProcess.setVariable("anotherVariableName", "aVariableValue");
// now the variable is set
assertEquals(Collections.singletonMap("anotherVariableName", "aVariableValue"), businessProcess.getVariableCache());
}