Search in sources :

Example 1 with DefaultTestRockerModelProvider

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

the class AwsAlexa method cancelIntentHandlerTest.

private void cancelIntentHandlerTest(GeneratorContext generatorContext, Project project) {
    String cancelIntentHandlerTest = generatorContext.getTestSourcePath("/{packagePath}/CancelIntentHandler");
    TestRockerModelProvider provider = new DefaultTestRockerModelProvider(cancelIntentHandlerGroovySpock.template(project), cancelIntentHandlerJavaJunit.template(project), cancelIntentHandlerGroovyJunit.template(project), cancelIntentHandlerKotlinJunit.template(project), cancelIntentHandlerKoTest.template(project));
    generatorContext.addTemplate("testCancelIntentHandler", cancelIntentHandlerTest, provider);
}
Also used : TestRockerModelProvider(io.micronaut.starter.options.TestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider)

Example 2 with DefaultTestRockerModelProvider

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

the class AwsAlexa method fallbackIntentHandlerTest.

private void fallbackIntentHandlerTest(GeneratorContext generatorContext, Project project) {
    String fallbackIntentHandlerTest = generatorContext.getTestSourcePath("/{packagePath}/FallbackIntentHandler");
    TestRockerModelProvider provider = new DefaultTestRockerModelProvider(fallbackIntentHandlerGroovySpock.template(project), fallbackIntentHandlerJavaJunit.template(project), fallbackIntentHandlerGroovyJunit.template(project), fallbackIntentHandlerKotlinJunit.template(project), fallbackIntentHandlerKoTest.template(project));
    generatorContext.addTemplate("testFallbackIntentHandler", fallbackIntentHandlerTest, provider);
}
Also used : TestRockerModelProvider(io.micronaut.starter.options.TestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider)

Example 3 with DefaultTestRockerModelProvider

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

the class AwsAlexa method helpIntentHandlerTest.

private void helpIntentHandlerTest(GeneratorContext generatorContext, Project project) {
    String helpIntentHandlerTest = generatorContext.getTestSourcePath("/{packagePath}/HelpIntentHandler");
    TestRockerModelProvider provider = new DefaultTestRockerModelProvider(helpIntentHandlerGroovySpock.template(project), helpIntentHandlerJavaJunit.template(project), helpIntentHandlerGroovyJunit.template(project), helpIntentHandlerKotlinJunit.template(project), helpIntentHandlerKoTest.template(project));
    generatorContext.addTemplate("testHelpIntentHandler", helpIntentHandlerTest, provider);
}
Also used : TestRockerModelProvider(io.micronaut.starter.options.TestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider)

Example 4 with DefaultTestRockerModelProvider

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

the class AbstractFunctionFeature method applyTestTemplate.

protected void applyTestTemplate(GeneratorContext generatorContext, Project project, String name) {
    String testSource = generatorContext.getTestSourcePath("/{packagePath}/" + name);
    TestRockerModelProvider provider = new DefaultTestRockerModelProvider(spockTemplate(project), javaJUnitTemplate(project), groovyJUnitTemplate(project), kotlinJUnitTemplate(project), koTestTemplate(project));
    generatorContext.addTemplate("testFunction", testSource, provider);
}
Also used : TestRockerModelProvider(io.micronaut.starter.options.TestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider)

Example 5 with DefaultTestRockerModelProvider

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

the class GroovyApplication method apply.

@Override
public void apply(GeneratorContext generatorContext) {
    GroovyApplicationFeature.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), groovyJunit.template(project), groovyJunit.template(project), groovyJunit.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

DefaultTestRockerModelProvider (io.micronaut.starter.options.DefaultTestRockerModelProvider)15 TestRockerModelProvider (io.micronaut.starter.options.TestRockerModelProvider)15 Project (io.micronaut.starter.application.Project)6 RockerTemplate (io.micronaut.starter.template.RockerTemplate)5 TestFramework (io.micronaut.starter.options.TestFramework)3 RockerModel (com.fizzed.rocker.RockerModel)2 RenderResult (io.micronaut.starter.template.RenderResult)2 TemplateRenderer (io.micronaut.starter.template.TemplateRenderer)2