Skip to content

Commit

Permalink
fix PMMLRestResourceGeneratorTest
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagodolphine committed Nov 16, 2020
1 parent 93bfcb2 commit 5e4aa33
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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));
Expand All @@ -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());
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5e4aa33

Please sign in to comment.