Search in sources :

Example 16 with TestRockerModelProvider

use of io.micronaut.starter.options.TestRockerModelProvider in project micronaut-starter by micronaut-projects.

the class JavaApplication method apply.

@Override
public void apply(GeneratorContext generatorContext) {
    JavaApplicationFeature.super.apply(generatorContext);
    if (shouldGenerateApplicationFile(generatorContext)) {
        generatorContext.addTemplate("application", new RockerTemplate(getPath(), application.template(generatorContext.getProject(), generatorContext.getFeatures())));
        TestFramework testFramework = generatorContext.getTestFramework();
        String testSourcePath = generatorContext.getTestSourcePath("/{packagePath}/{className}");
        Project project = generatorContext.getProject();
        TestRockerModelProvider provider = new DefaultTestRockerModelProvider(spock.template(project), javaJunit.template(project), javaJunit.template(project), javaJunit.template(project), koTest.template(project));
        generatorContext.addTemplate("applicationTest", new RockerTemplate(testSourcePath, provider.findModel(generatorContext.getLanguage(), testFramework)));
    }
}
Also used : RockerTemplate(io.micronaut.starter.template.RockerTemplate) Project(io.micronaut.starter.application.Project) TestFramework(io.micronaut.starter.options.TestFramework) TestRockerModelProvider(io.micronaut.starter.options.TestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider)

Aggregations

TestRockerModelProvider (io.micronaut.starter.options.TestRockerModelProvider)16 DefaultTestRockerModelProvider (io.micronaut.starter.options.DefaultTestRockerModelProvider)15 Project (io.micronaut.starter.application.Project)7 RockerTemplate (io.micronaut.starter.template.RockerTemplate)6 RockerModel (com.fizzed.rocker.RockerModel)3 TestFramework (io.micronaut.starter.options.TestFramework)3 RenderResult (io.micronaut.starter.template.RenderResult)3 TemplateRenderer (io.micronaut.starter.template.TemplateRenderer)3 AbstractTestRockerModelProvider (io.micronaut.starter.options.AbstractTestRockerModelProvider)1 Language (io.micronaut.starter.options.Language)1