Search in sources :

Example 1 with JITDMNPayload

use of org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload in project kogito-apps by kiegroup.

the class JITDMNResourceTest method testjitdmnResultEndpoint.

@Test
public void testjitdmnResultEndpoint() {
    JITDMNPayload jitdmnpayload = new JITDMNPayload(model, buildContext());
    given().contentType(ContentType.JSON).body(jitdmnpayload).when().post("/jitdmn/dmnresult").then().statusCode(200).body(containsString("Loan Approval"), containsString("Approved"), containsString("xls2dmn"));
}
Also used : JITDMNPayload(org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload) Test(org.junit.jupiter.api.Test) QuarkusTest(io.quarkus.test.junit.QuarkusTest)

Example 2 with JITDMNPayload

use of org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload in project kogito-apps by kiegroup.

the class JITDMNResourceTest method testjitEndpoint.

@Test
public void testjitEndpoint() {
    JITDMNPayload jitdmnpayload = new JITDMNPayload(model, buildContext());
    given().contentType(ContentType.JSON).body(jitdmnpayload).when().post("/jitdmn").then().statusCode(200).body(containsString("Loan Approval"), containsString("Approved"));
}
Also used : JITDMNPayload(org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload) Test(org.junit.jupiter.api.Test) QuarkusTest(io.quarkus.test.junit.QuarkusTest)

Example 3 with JITDMNPayload

use of org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload in project kogito-apps by kiegroup.

the class MultipleModelsTest method testjitExplainabilityEndpoint.

@Test
public void testjitExplainabilityEndpoint() {
    JITDMNPayload jitdmnpayload = new JITDMNPayload(XAIURI1, List.of(xaimodel1, model1, model2), Map.of("FICO Score", 800, "DTI Ratio", .1, "PITI Ratio", .1));
    given().contentType(ContentType.JSON).body(jitdmnpayload).when().post("/jitdmn/evaluateAndExplain").then().statusCode(200).body(containsString("dmnResult"), containsString("saliencies"), containsString("xls2dmn"), containsString("featureName"));
}
Also used : JITDMNPayload(org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Example 4 with JITDMNPayload

use of org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload in project kogito-apps by kiegroup.

the class JITDMNResourceTest method testjitExplainabilityEndpoint.

@Test
public void testjitExplainabilityEndpoint() {
    JITDMNPayload jitdmnpayload = new JITDMNPayload(model, buildContext());
    given().contentType(ContentType.JSON).body(jitdmnpayload).when().post("/jitdmn/evaluateAndExplain").then().statusCode(200).body(containsString("dmnResult"), containsString("saliencies"), containsString("xls2dmn"), containsString("featureName"));
}
Also used : JITDMNPayload(org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload) Test(org.junit.jupiter.api.Test) QuarkusTest(io.quarkus.test.junit.QuarkusTest)

Example 5 with JITDMNPayload

use of org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload in project kogito-apps by kiegroup.

the class JITDMNResourceTest method testjitdmnWithExtensionElements.

@Test
public void testjitdmnWithExtensionElements() {
    Map<String, Object> context = new HashMap<>();
    context.put("m", 1);
    context.put("n", 2);
    JITDMNPayload jitdmnpayload = new JITDMNPayload(modelWithExtensionElements, context);
    given().contentType(ContentType.JSON).body(jitdmnpayload).when().post("/jitdmn/dmnresult").then().statusCode(200).body(containsString("m"), containsString("n"), containsString("sum"));
}
Also used : JITDMNPayload(org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload) HashMap(java.util.HashMap) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) Test(org.junit.jupiter.api.Test) QuarkusTest(io.quarkus.test.junit.QuarkusTest)

Aggregations

QuarkusTest (io.quarkus.test.junit.QuarkusTest)10 Test (org.junit.jupiter.api.Test)10 JITDMNPayload (org.kie.kogito.jitexecutor.dmn.requests.JITDMNPayload)10 HashMap (java.util.HashMap)2 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)2 JITDMNResult (org.kie.kogito.jitexecutor.dmn.responses.JITDMNResult)1