ConfigGenerator { public ConfigGenerator withProcessConfig(ProcessConfigGenerator cfg) { this.processConfig = cfg; if (this.processConfig != null) { this.processConfig.withDependencyInjection(annotator); } return this; } ConfigGenerator(String packageName); ConfigGenerator withProcessConfig(ProcessConfigGenerator cfg); ConfigGenerator withRuleConfig(RuleConfigGenerator cfg); ConfigGenerator withDecisionConfig(DecisionConfigGenerator cfg); ConfigGenerator withPredictionConfig(PredictionConfigGenerator cfg); ConfigGenerator withDependencyInjection(DependencyInjectionAnnotator annotator); ObjectCreationExpr newInstance(); Collection<GeneratedFile> generate(); void withAddons(Collection<String> addons);  }
@Test public void withProcessConfig() { final ConfigGenerator generator = new ConfigGenerator("org.kie.kogito.test"); final ProcessConfigGenerator processConfigGenerator = Mockito.mock(ProcessConfigGenerator.class); final ConfigGenerator returnedConfigGenerator = generator.withProcessConfig(processConfigGenerator); assertThat(returnedConfigGenerator).isNotNull(); assertThat(returnedConfigGenerator).isSameAs(generator); }
@Test public void withProcessConfigNull() { final ConfigGenerator generator = new ConfigGenerator("org.kie.kogito.test"); final ConfigGenerator returnedConfigGenerator = generator.withProcessConfig(null); assertThat(returnedConfigGenerator).isNotNull(); assertThat(returnedConfigGenerator).isSameAs(generator); }