PredictionContainerGenerator extends AbstractApplicationSection { @Override public ClassOrInterfaceDeclaration classDeclaration() { CompilationUnit clazz = StaticJavaParser.parse(this.getClass().getResourceAsStream(TEMPLATE_JAVA)); ClassOrInterfaceDeclaration typeDeclaration = (ClassOrInterfaceDeclaration) clazz.getTypes().get(0); populateStaticKieRuntimeFactoryFunctionInit(typeDeclaration); return typeDeclaration; } PredictionContainerGenerator(String applicationCanonicalName, List<PMMLResource> resources); PredictionContainerGenerator withAddons(AddonsConfig addonsConfig); @Override ClassOrInterfaceDeclaration classDeclaration(); void addPredictionRulesMapperClass(String predictionRulesMapperClass);  }
@Test void classDeclaration() { ClassOrInterfaceDeclaration retrieved = predictionContainerGenerator.classDeclaration(); assertNotNull(retrieved); String retrievedString = retrieved.toString(); String expected = PMML_RESOURCES .stream() .map(pmmlResource -> "\"" + pmmlResource.getModelPath() + "\"") .collect(Collectors.joining(", ")); expected = String.format("org.kie.kogito.pmml.PMMLKogito.createKieRuntimeFactories(%s);", expected); assertTrue(retrievedString.contains(expected)); }