From 5e4aa33486613b2053d2205761563394907605ad Mon Sep 17 00:00:00 2001 From: Tiago Dolphine Date: Thu, 12 Nov 2020 16:49:04 -0300 Subject: [PATCH] fix PMMLRestResourceGeneratorTest --- .../codegen/prediction/PMMLRestResourceGeneratorTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kogito-codegen/src/test/java/org/kie/kogito/codegen/prediction/PMMLRestResourceGeneratorTest.java b/kogito-codegen/src/test/java/org/kie/kogito/codegen/prediction/PMMLRestResourceGeneratorTest.java index f0f96630795..d074b0f5c5f 100644 --- a/kogito-codegen/src/test/java/org/kie/kogito/codegen/prediction/PMMLRestResourceGeneratorTest.java +++ b/kogito-codegen/src/test/java/org/kie/kogito/codegen/prediction/PMMLRestResourceGeneratorTest.java @@ -33,6 +33,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.kie.dmn.feel.codegen.feel11.CodegenStringUtil; +import org.kie.kogito.codegen.di.CDIDependencyInjectionAnnotator; import org.kie.kogito.codegen.di.DependencyInjectionAnnotator; import org.kie.pmml.commons.model.KiePMMLModel; @@ -88,7 +89,7 @@ void constructor() { @Test void generateWithDependencyInjection() { - String retrieved = pmmlRestResourceGenerator.withDependencyInjection(mock(DependencyInjectionAnnotator.class)).generate(); + String retrieved = pmmlRestResourceGenerator.withDependencyInjection(new CDIDependencyInjectionAnnotator()).generate(); commonEvaluateGenerate(retrieved); String expected = "Application application;"; assertTrue(retrieved.contains(expected)); @@ -105,7 +106,7 @@ void generateWithoutDependencyInjection() { @Test void getNameURL() { String classPrefix = getSanitizedClassName(KIE_PMML_MODEL.getName()); - String expected = URLEncoder.encode(classPrefix).replaceAll("\\+", "%20"); + String expected = URLEncoder.encode(classPrefix).replaceAll("\\+", " "); assertEquals(expected, pmmlRestResourceGenerator.getNameURL()); } @@ -157,7 +158,7 @@ void setPathValue() { pmmlRestResourceGenerator.setPathValue(template); try { String classPrefix = getSanitizedClassName(KIE_PMML_MODEL.getName()); - String expected = URLEncoder.encode(classPrefix).replaceAll("\\+", "%20"); + String expected = URLEncoder.encode(classPrefix).replaceAll("\\+", " "); assertEquals(expected, retrieved.getMemberValue().asStringLiteralExpr().asString()); } catch (Exception e) { fail(e);