use of org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload in project kogito-apps by kiegroup.
the class MultipleModelsTest method testjitEndpoint.
@Test
public void testjitEndpoint() {
JITDMNPayload jitdmnpayload = new JITDMNPayload(URI1, List.of(model1, model2), buildContext());
given().contentType(ContentType.JSON).body(jitdmnpayload).when().post("/jitdmn").then().statusCode(200).body("'my decision'", is("Ciao, John Doe (age:47)."));
}
use of org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload in project kogito-apps by kiegroup.
the class MultipleModelsTest method testjitEndpointCH11.
@Test
public void testjitEndpointCH11() {
JITDMNPayload jitdmnpayload = new JITDMNPayload(CH11URI1, List.of(ch11model1, ch11model2), buildCH11Context());
given().contentType(ContentType.JSON).body(jitdmnpayload).when().post("/jitdmn").then().statusCode(200).body("Strategy", is("THROUGH"));
}
use of org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload 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));
}
use of org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload in project kogito-apps by kiegroup.
the class MultipleModelsTest method testjitdmnResultEndpoint.
@Test
public void testjitdmnResultEndpoint() {
JITDMNPayload jitdmnpayload = new JITDMNPayload(URI1, List.of(model1, model2), buildContext());
given().contentType(ContentType.JSON).body(jitdmnpayload).when().post("/jitdmn/dmnresult").then().statusCode(200).body("dmnContext.'my decision'", is("Ciao, John Doe (age:47)."));
}
use of org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload in project kogito-apps by kiegroup.
the class MultipleModelsTest method testjitdmnResultEndpointCH11.
@Test
public void testjitdmnResultEndpointCH11() {
JITDMNPayload jitdmnpayload = new JITDMNPayload(CH11URI1, List.of(ch11model1, ch11model2), buildCH11Context());
given().contentType(ContentType.JSON).body(jitdmnpayload).when().post("/jitdmn/dmnresult").then().statusCode(200).body("dmnContext.Strategy", is("THROUGH"));
}
Aggregations