use of io.automatiko.engine.codegen.process.config.ProcessConfigGenerator in project automatiko-engine by automatiko-io.
the class ConfigGeneratorTest method newInstanceTest.
private void newInstanceTest(final ProcessConfigGenerator processConfigGenerator, final Class<?> expectedArgumentType) {
ObjectCreationExpr expression = new ConfigGenerator("org.kie.kogito.test").withProcessConfig(processConfigGenerator).newInstance();
assertThat(expression).isNotNull();
assertThat(expression.getType()).isNotNull();
assertThat(expression.getType().asString()).isEqualTo("org.kie.kogito.test.ApplicationConfig");
assertThat(expression.getArguments()).isNotNull();
assertThat(expression.getArguments()).hasSize(0);
}
use of io.automatiko.engine.codegen.process.config.ProcessConfigGenerator in project automatiko-engine by automatiko-io.
the class ConfigGeneratorTest method withProcessConfig.
@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);
}
use of io.automatiko.engine.codegen.process.config.ProcessConfigGenerator in project automatiko-engine by automatiko-io.
the class ConfigGeneratorTest method newInstanceWithProcessConfig.
@Test
public void newInstanceWithProcessConfig() {
final ProcessConfigGenerator processConfigGenerator = Mockito.mock(ProcessConfigGenerator.class);
Mockito.when(processConfigGenerator.newInstance()).thenReturn(new ObjectCreationExpr());
newInstanceTest(processConfigGenerator, ObjectCreationExpr.class);
}
Aggregations