Search in sources :

Example 1 with ConfigGenerator

use of io.automatiko.engine.codegen.ConfigGenerator 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);
}
Also used : ObjectCreationExpr(com.github.javaparser.ast.expr.ObjectCreationExpr) ConfigGenerator(io.automatiko.engine.codegen.ConfigGenerator) ProcessConfigGenerator(io.automatiko.engine.codegen.process.config.ProcessConfigGenerator)

Example 2 with ConfigGenerator

use of io.automatiko.engine.codegen.ConfigGenerator 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);
}
Also used : ConfigGenerator(io.automatiko.engine.codegen.ConfigGenerator) ProcessConfigGenerator(io.automatiko.engine.codegen.process.config.ProcessConfigGenerator) ProcessConfigGenerator(io.automatiko.engine.codegen.process.config.ProcessConfigGenerator) Test(org.junit.jupiter.api.Test)

Example 3 with ConfigGenerator

use of io.automatiko.engine.codegen.ConfigGenerator in project automatiko-engine by automatiko-io.

the class ConfigGeneratorTest method withProcessConfigNull.

@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);
}
Also used : ConfigGenerator(io.automatiko.engine.codegen.ConfigGenerator) ProcessConfigGenerator(io.automatiko.engine.codegen.process.config.ProcessConfigGenerator) Test(org.junit.jupiter.api.Test)

Aggregations

ConfigGenerator (io.automatiko.engine.codegen.ConfigGenerator)3 ProcessConfigGenerator (io.automatiko.engine.codegen.process.config.ProcessConfigGenerator)3 Test (org.junit.jupiter.api.Test)2 ObjectCreationExpr (com.github.javaparser.ast.expr.ObjectCreationExpr)1