From 58206ce7d17d3723a53796caec0d3e78cdc2e5e2 Mon Sep 17 00:00:00 2001 From: Gabriele Cardosi Date: Tue, 9 Apr 2024 07:30:02 +0200 Subject: [PATCH] [incubator-kie-issues#1066] Renaming model names used in test (#2030) Co-authored-by: Gabriele-Cardosi --- .../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 4e2ddf2fa6..a581ae7436 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 @@ public static void setup() { } @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 @@ void unnamedImport() throws IOException { 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 @@ void unnamedImport() throws IOException { Map 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)