Skip to content

Commit

Permalink
[incubator-kie-issues#1066] Renaming model names used in test (apache…
Browse files Browse the repository at this point in the history
…#2030)

Co-authored-by: Gabriele-Cardosi <[email protected]>
  • Loading branch information
2 people authored and rgdoliveira committed Apr 16, 2024
1 parent 9665c45 commit 58206ce
Showing 1 changed file with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand All @@ -92,7 +102,7 @@ void unnamedImport() throws IOException {

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)
Expand Down

0 comments on commit 58206ce

Please sign in to comment.