use of org.kie.kogito.jitexecutor.dmn.responses.JITDMNResult in project kogito-apps by kiegroup.
the class MultipleModelsTest method testjitdmnResultEndpointCH11_withErrors.
@Test
public void testjitdmnResultEndpointCH11_withErrors() throws Exception {
// will omit `Applicant data` intentionally.
Map<String, Object> context = new HashMap<>();
context.put("Bureau data", Map.of("Bankrupt", false, "CreditScore", 600));
context.put("Requested product", Map.of("ProductType", "STANDARD LOAN", "Rate", 0.08d, "Term", 36, "Amount", 100_00));
JITDMNPayload jitdmnpayload = new JITDMNPayload(CH11URI1, List.of(ch11model1, ch11model2), context);
String response = given().contentType(ContentType.JSON).body(jitdmnpayload).when().post("/jitdmn/dmnresult").then().statusCode(200).body("dmnContext.'Required monthly installment'", notNullValue()).extract().asString();
JITDMNResult result = MAPPER.readValue(response, JITDMNResult.class);
assertThat(result.getMessages()).isNotEmpty().allMatch(m -> m.getPath().equals(CH11URI1));
}
Aggregations