use of org.camunda.bpm.engine.rest.helper.MockDecisionResultBuilder in project camunda-bpm-platform by camunda.
the class DecisionDefinitionRestServiceInteractionTest method testEvaluateDecisionMultipleDecisionValues.
@Test
public void testEvaluateDecisionMultipleDecisionValues() {
DmnDecisionResult decisionResult = new MockDecisionResultBuilder().resultEntries().entry("status", Variables.stringValue("gold")).entry("assignee", Variables.stringValue("manager")).build();
when(decisionEvaluationBuilderMock.evaluate()).thenReturn(decisionResult);
Map<String, Object> json = new HashMap<String, Object>();
json.put("variables", Collections.emptyMap());
given().pathParam("id", MockProvider.EXAMPLE_DECISION_DEFINITION_ID).contentType(POST_JSON_CONTENT_TYPE).body(json).then().expect().statusCode(Status.OK.getStatusCode()).body("size()", is(1)).body("[0].size()", is(2)).body("[0].status.value", is("gold")).body("[0].assignee.value", is("manager")).when().post(EVALUATE_DECISION_URL);
}
use of org.camunda.bpm.engine.rest.helper.MockDecisionResultBuilder in project camunda-bpm-platform by camunda.
the class DecisionDefinitionRestServiceInteractionTest method testEvaluateDecisionMultipleDecisionOutputs.
@Test
public void testEvaluateDecisionMultipleDecisionOutputs() {
DmnDecisionResult decisionResult = new MockDecisionResultBuilder().resultEntries().entry("status", Variables.stringValue("gold")).resultEntries().entry("assignee", Variables.stringValue("manager")).build();
when(decisionEvaluationBuilderMock.evaluate()).thenReturn(decisionResult);
Map<String, Object> json = new HashMap<String, Object>();
json.put("variables", Collections.emptyMap());
given().pathParam("id", MockProvider.EXAMPLE_DECISION_DEFINITION_ID).contentType(POST_JSON_CONTENT_TYPE).body(json).then().expect().statusCode(Status.OK.getStatusCode()).body("size()", is(2)).body("[0].size()", is(1)).body("[0].status.value", is("gold")).body("[1].size()", is(1)).body("[1].assignee.value", is("manager")).when().post(EVALUATE_DECISION_URL);
}
use of org.camunda.bpm.engine.rest.helper.MockDecisionResultBuilder in project camunda-bpm-platform by camunda.
the class DecisionDefinitionRestServiceInteractionTest method testEvaluateDecisionSingleDecisionOutput.
@Test
public void testEvaluateDecisionSingleDecisionOutput() {
DmnDecisionResult decisionResult = new MockDecisionResultBuilder().resultEntries().entry("status", Variables.stringValue("gold")).build();
when(decisionEvaluationBuilderMock.evaluate()).thenReturn(decisionResult);
Map<String, Object> json = new HashMap<String, Object>();
json.put("variables", Collections.emptyMap());
given().pathParam("id", MockProvider.EXAMPLE_DECISION_DEFINITION_ID).contentType(POST_JSON_CONTENT_TYPE).body(json).then().expect().statusCode(Status.OK.getStatusCode()).body("size()", is(1)).body("[0].size()", is(1)).body("[0].status", is(notNullValue())).body("[0].status.value", is("gold")).when().post(EVALUATE_DECISION_URL);
}
Aggregations