You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by gi...@apache.org on 2024/04/09 05:30:06 UTC

(incubator-kie-kogito-apps) branch main updated: [incubator-kie-issues#1066] Renaming model names used in test (#2030)

This is an automated email from the ASF dual-hosted git repository.

gitgabrio pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-apps.git


The following commit(s) were added to refs/heads/main by this push:
     new b3314975a [incubator-kie-issues#1066] Renaming model names used in test (#2030)
b3314975a is described below

commit b3314975a45dcd89ed9724f87d653d840e9f30a0
Author: Gabriele Cardosi <ga...@gmail.com>
AuthorDate: Tue Apr 9 07:30:02 2024 +0200

    [incubator-kie-issues#1066] Renaming model names used in test (#2030)
    
    Co-authored-by: Gabriele-Cardosi <ga...@ibm.com>
---
 .../org/kie/kogito/jitexecutor/dmn/DMN15Test.java  | 26 +++++++++++++++-------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/DMN15Test.java b/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/DMN15Test.java
index 4e2ddf2fa..a581ae743 100644
--- a/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/DMN15Test.java
+++ b/jitexecutor/jitexecutor-dmn/src/test/java/org/kie/kogito/jitexecutor/dmn/DMN15Test.java
@@ -61,13 +61,23 @@ class DMN15Test {
     }
 
     @Test
-    void unnamedImport() throws IOException {
-        String URI1 = "valid_models/DMNv1_5/Importing_EmptyNamed_Model.dmn";
-        String URI2 = "valid_models/DMNv1_5/Imported_Model_Unamed.dmn";
-        ResourceWithURI model1 = new ResourceWithURI(URI1, getModelFromIoUtils(URI1));
-        ResourceWithURI model2 = new ResourceWithURI(URI2, getModelFromIoUtils(URI2));
+    void unnamedImportWithHrefNamespace() throws IOException {
+        commonUnnamedImport("valid_models/DMNv1_5/Importing_EmptyNamed_Model_With_Href_Namespace.dmn",
+                "valid_models/DMNv1_5/Imported_Model_Unamed.dmn");
+    }
+
+    @Test
+    void unnamedImportWithoutHrefNamespace() throws IOException {
+        commonUnnamedImport("valid_models/DMNv1_5/Importing_EmptyNamed_Model_Without_Href_Namespace.dmn",
+                "valid_models/DMNv1_5/Imported_Model_Unamed.dmn");
+    }
+
+    private void commonUnnamedImport(String importingModelRef, String importedModelRef) throws IOException {
+        ResourceWithURI model1 = new ResourceWithURI(importingModelRef, getModelFromIoUtils(importingModelRef));
+        ResourceWithURI model2 = new ResourceWithURI(importedModelRef, getModelFromIoUtils(importedModelRef));
 
-        JITDMNPayload jitdmnpayload = new JITDMNPayload(URI1, List.of(model1, model2), Collections.EMPTY_MAP);
+        JITDMNPayload jitdmnpayload = new JITDMNPayload(importingModelRef, List.of(model1, model2),
+                Collections.EMPTY_MAP);
         given()
                 .contentType(ContentType.JSON)
                 .body(jitdmnpayload)
@@ -79,7 +89,7 @@ class DMN15Test {
 
         String response = given()
                 .contentType(ContentType.JSON)
-                .body(new MultipleResourcesPayload(URI1, List.of(model1, model2)))
+                .body(new MultipleResourcesPayload(importingModelRef, List.of(model1, model2)))
                 .when()
                 .post("/jitdmn/validate")
                 .then()
@@ -92,7 +102,7 @@ class DMN15Test {
 
         Map<String, Object> context =
                 Map.of("A Person", Map.of("name", "John", "age", 47));
-        jitdmnpayload = new JITDMNPayload(URI1, List.of(model1, model2), context);
+        jitdmnpayload = new JITDMNPayload(importingModelRef, List.of(model1, model2), context);
         given()
                 .contentType(ContentType.JSON)
                 .body(jitdmnpayload)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org