use of org.camunda.bpm.engine.variable.impl.VariableMapImpl in project camunda-bpm-platform by camunda.
the class AbstractVariableScope method getVariablesTyped.
public VariableMapImpl getVariablesTyped(boolean deserializeValues) {
VariableMapImpl variableMap = new VariableMapImpl();
collectVariables(variableMap, null, false, deserializeValues);
return variableMap;
}
use of org.camunda.bpm.engine.variable.impl.VariableMapImpl in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceInteractionTest method testProcessInstantiationWithTransientVariables.
@Test
public void testProcessInstantiationWithTransientVariables() throws IOException {
Map<String, Object> json = new HashMap<String, Object>();
json.put("variables", VariablesBuilder.create().variableTransient("foo", "bar", "string").getVariables());
final VariableMap varMap = new VariableMapImpl();
when(mockInstantiationBuilder.setVariables(anyMapOf(String.class, Object.class))).thenAnswer(new Answer<ProcessInstantiationBuilder>() {
@Override
public ProcessInstantiationBuilder answer(InvocationOnMock invocation) throws Throwable {
varMap.putAll((VariableMap) invocation.getArguments()[0]);
return mockInstantiationBuilder;
}
});
given().pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID).contentType(POST_JSON_CONTENT_TYPE).body(json).then().expect().statusCode(Status.OK.getStatusCode()).body("id", equalTo(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID)).when().post(START_PROCESS_INSTANCE_URL);
VariableMap expectedVariables = Variables.createVariables().putValueTyped("foo", Variables.stringValue("bar", true));
verify(runtimeServiceMock).createProcessInstanceById(eq(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID));
verify(mockInstantiationBuilder).setVariables(expectedVariables);
assertEquals(expectedVariables.getValueTyped("foo").isTransient(), varMap.getValueTyped("foo").isTransient());
verify(mockInstantiationBuilder).executeWithVariablesInReturn(anyBoolean(), anyBoolean());
}
Aggregations