use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.
the class ConnectProcessEnginePluginTest method testConnectorRuntimeExceptionThrownInScriptResourceInputMappingIsNotHandledByBoundaryEvent.
@Deployment(resources = "org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorWithThrownExceptionInScriptResourceInputOutputMapping.bpmn")
public void testConnectorRuntimeExceptionThrownInScriptResourceInputMappingIsNotHandledByBoundaryEvent() {
String exceptionMessage = "myException";
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("throwInMapping", "in");
variables.put("exception", new RuntimeException(exceptionMessage));
try {
runtimeService.startProcessInstanceByKey("testProcess", variables);
} catch (RuntimeException re) {
assertThat(re.getMessage(), containsString(exceptionMessage));
}
}
use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.
the class ConnectProcessEnginePluginTest method testConnectorBpmnErrorThrownInScriptInputMappingIsHandledByBoundaryEvent.
@Deployment(resources = "org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorWithThrownExceptionInScriptInputOutputMapping.bpmn")
public void testConnectorBpmnErrorThrownInScriptInputMappingIsHandledByBoundaryEvent() {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("throwInMapping", "in");
variables.put("exception", new BpmnError("error"));
runtimeService.startProcessInstanceByKey("testProcess", variables);
// we will only reach the user task if the BPMNError from the script was handled by the boundary event
Task task = taskService.createTaskQuery().singleResult();
assertThat(task.getName(), is("User Task"));
}
use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.
the class ConnectProcessEnginePluginTest method testConnectorInvoked.
@Deployment
public void testConnectorInvoked() {
String outputParamValue = "someOutputValue";
String inputVariableValue = "someInputVariableValue";
TestConnector.responseParameters.put("someOutputParameter", outputParamValue);
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("someInputVariable", inputVariableValue);
runtimeService.startProcessInstanceByKey("testProcess", vars);
// validate input parameter
assertNotNull(TestConnector.requestParameters.get("reqParam1"));
assertEquals(inputVariableValue, TestConnector.requestParameters.get("reqParam1"));
// validate connector output
VariableInstance variable = runtimeService.createVariableInstanceQuery().variableName("out1").singleResult();
assertNotNull(variable);
assertEquals(outputParamValue, variable.getValue());
}
use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.
the class ConnectProcessEnginePluginTest method testConnectorBpmnErrorThrownInScriptResourceOutputMappingIsHandledByBoundaryEvent.
@Deployment(resources = "org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorWithThrownExceptionInScriptResourceInputOutputMapping.bpmn")
public void testConnectorBpmnErrorThrownInScriptResourceOutputMappingIsHandledByBoundaryEvent() {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("throwInMapping", "out");
variables.put("exception", new BpmnError("error"));
runtimeService.startProcessInstanceByKey("testProcess", variables);
// we will only reach the user task if the BPMNError from the script was handled by the boundary event
Task task = taskService.createTaskQuery().singleResult();
assertThat(task.getName(), is("User Task"));
}
use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.
the class ConnectProcessEnginePluginTest method testConnectorRuntimeExceptionThrownInScriptInputMappingIsNotHandledByBoundaryEvent.
@Deployment(resources = "org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorWithThrownExceptionInScriptInputOutputMapping.bpmn")
public void testConnectorRuntimeExceptionThrownInScriptInputMappingIsNotHandledByBoundaryEvent() {
String exceptionMessage = "myException";
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("throwInMapping", "in");
variables.put("exception", new RuntimeException(exceptionMessage));
try {
runtimeService.startProcessInstanceByKey("testProcess", variables);
} catch (RuntimeException re) {
assertThat(re.getMessage(), containsString(exceptionMessage));
}
}
Aggregations