diff --git a/kogito-codegen-modules/kogito-codegen-predictions/src/test/java/org/kie/kogito/codegen/prediction/PredictionCodegenGenerateTest.java b/kogito-codegen-modules/kogito-codegen-predictions/src/test/java/org/kie/kogito/codegen/prediction/PredictionCodegenGenerateTest.java index 410c562db7a..c119c0f74ad 100644 --- a/kogito-codegen-modules/kogito-codegen-predictions/src/test/java/org/kie/kogito/codegen/prediction/PredictionCodegenGenerateTest.java +++ b/kogito-codegen-modules/kogito-codegen-predictions/src/test/java/org/kie/kogito/codegen/prediction/PredictionCodegenGenerateTest.java @@ -34,7 +34,6 @@ import org.drools.codegen.common.GeneratedFileType; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -56,7 +55,6 @@ import static org.kie.kogito.codegen.prediction.PredictionCodegenFactory.parsePredictions; import static org.kie.kogito.codegen.prediction.PredictionCodegenFactoryTest.REFLECT_JSON; -@Disabled("Temporarily disabled due to https://github.com/apache/incubator-kie-kogito-runtimes/issues/3640") class PredictionCodegenGenerateTest { static final Path BASE_PATH = Paths.get("src/test/resources/").toAbsolutePath(); @@ -96,19 +94,19 @@ private static Stream data() { codeGenerator = getPredictionCodegen(context, SCORECARD_FULL_SOURCE); generatedFiles = codeGenerator.generate(); - toAdd = arguments(codeGenerator, generatedFiles, 36, 34, 1, false, + toAdd = arguments(codeGenerator, generatedFiles, 4, 3, 1, false, context.hasRESTForGenerator(codeGenerator)); testArguments.add(toAdd); codeGenerator = getPredictionCodegen(context, MINING_FULL_SOURCE); generatedFiles = codeGenerator.generate(); - toAdd = arguments(codeGenerator, generatedFiles, 79, 77, 1, false, + toAdd = arguments(codeGenerator, generatedFiles, 13, 12, 1, false, context.hasRESTForGenerator(codeGenerator)); testArguments.add(toAdd); codeGenerator = getPredictionCodegen(context, MULTIPLE_FULL_SOURCE); generatedFiles = codeGenerator.generate(); - toAdd = arguments(codeGenerator, generatedFiles, 86, 84, 2, false, + toAdd = arguments(codeGenerator, generatedFiles, 13, 12, 2, false, context.hasRESTForGenerator(codeGenerator)); testArguments.add(toAdd); return testArguments.stream(); @@ -196,10 +194,11 @@ static void commonVerifyTotalFiles(Collection generatedFiles, static void commonVerifyCompiledClasses(Collection generatedFiles, int expectedCompiledClasses) { - assertThat(expectedCompiledClasses).isEqualTo(generatedFiles.stream() + int actuallyCompiledClasses = (int) generatedFiles.stream() .filter(generatedFile -> generatedFile.category().equals(GeneratedFileType.Category.COMPILED_CLASS) && generatedFile.type().equals(COMPILED_CLASS)) - .count()); + .count(); + assertThat(actuallyCompiledClasses).isEqualTo(expectedCompiledClasses); } static void commonVerifyReflectResource(Collection generatedFiles, diff --git a/kogito-codegen-modules/kogito-codegen-predictions/src/test/java/org/kie/kogito/codegen/prediction/PredictionCodegenInternalGenerateTest.java b/kogito-codegen-modules/kogito-codegen-predictions/src/test/java/org/kie/kogito/codegen/prediction/PredictionCodegenInternalGenerateTest.java index c5c03d24899..044ffdd442d 100644 --- a/kogito-codegen-modules/kogito-codegen-predictions/src/test/java/org/kie/kogito/codegen/prediction/PredictionCodegenInternalGenerateTest.java +++ b/kogito-codegen-modules/kogito-codegen-predictions/src/test/java/org/kie/kogito/codegen/prediction/PredictionCodegenInternalGenerateTest.java @@ -29,7 +29,6 @@ import org.drools.codegen.common.GeneratedFile; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -49,7 +48,6 @@ import static org.kie.kogito.codegen.prediction.PredictionCodegenGenerateTest.commonVerifyTotalFiles; import static org.kie.kogito.codegen.prediction.PredictionCodegenGenerateTest.getPredictionCodegen; -@Disabled("Temporarily disabled due to https://github.com/apache/incubator-kie-kogito-runtimes/issues/3640") class PredictionCodegenInternalGenerateTest { @BeforeAll @@ -80,19 +78,19 @@ private static Stream data() { codeGenerator = getPredictionCodegen(context, SCORECARD_FULL_SOURCE); generatedFiles = codeGenerator.internalGenerate(); - toAdd = arguments(codeGenerator, generatedFiles, 36, 34, 1, false, + toAdd = arguments(codeGenerator, generatedFiles, 4, 3, 1, false, context.hasRESTForGenerator(codeGenerator)); testArguments.add(toAdd); codeGenerator = getPredictionCodegen(context, MINING_FULL_SOURCE); generatedFiles = codeGenerator.internalGenerate(); - toAdd = arguments(codeGenerator, generatedFiles, 79, 77, 1, false, + toAdd = arguments(codeGenerator, generatedFiles, 13, 12, 1, false, context.hasRESTForGenerator(codeGenerator)); testArguments.add(toAdd); codeGenerator = getPredictionCodegen(context, MULTIPLE_FULL_SOURCE); generatedFiles = codeGenerator.internalGenerate(); - toAdd = arguments(codeGenerator, generatedFiles, 86, 84, 2, false, + toAdd = arguments(codeGenerator, generatedFiles, 13, 12, 2, false, context.hasRESTForGenerator(codeGenerator)); testArguments.add(toAdd); return testArguments.stream();