Search in sources :

Example 11 with TestRockerModelProvider

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

the class AwsAlexa method sessionEndedIntentHandlerTest.

private void sessionEndedIntentHandlerTest(GeneratorContext generatorContext, Project project) {
    String sessionEndedIntentHandlerTest = generatorContext.getTestSourcePath("/{packagePath}/SessionEndedRequestIntentHandler");
    TestRockerModelProvider provider = new DefaultTestRockerModelProvider(sessionEndedRequestIntentHandlerGroovySpock.template(project), sessionEndedRequestIntentHandlerJavaJunit.template(project), sessionEndedRequestIntentHandlerGroovyJunit.template(project), sessionEndedRequestIntentHandlerKotlinJunit.template(project), sessionEndedRequestIntentHandlerKoTest.template(project));
    generatorContext.addTemplate("testSessionEndedRequestIntentHandler", sessionEndedIntentHandlerTest, provider);
}
Also used : TestRockerModelProvider(io.micronaut.starter.options.TestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider)

Example 12 with TestRockerModelProvider

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

the class AwsLambda method addBookControllerTest.

private void addBookControllerTest(GeneratorContext generatorContext, Project project) {
    String testSource = generatorContext.getTestSourcePath("/{packagePath}/BookController");
    TestRockerModelProvider provider = new DefaultTestRockerModelProvider(bookControllerSpock.template(project), bookControllerJavaJunit.template(project), bookControllerGroovyJunit.template(project), bookControllerKotlinJunit.template(project), bookControllerKoTest.template(project));
    generatorContext.addTemplate("testBookController", testSource, provider);
}
Also used : TestRockerModelProvider(io.micronaut.starter.options.TestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider)

Example 13 with TestRockerModelProvider

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

the class AwsLambda method addTest.

private void addTest(GeneratorContext generatorContext, Project project) {
    String testSource = generatorContext.getTestSourcePath("/{packagePath}/BookRequestHandler");
    TestRockerModelProvider provider = new DefaultTestRockerModelProvider(awsLambdaBookRequestHandlerSpock.template(project), awsLambdaBookRequestHandlerJavaJunit.template(project), awsLambdaBookRequestHandlerGroovyJunit.template(project), awsLambdaBookRequestHandlerKotlinJunit.template(project), awsLambdaBookRequestHandlerKoTest.template(project));
    generatorContext.addTemplate("testBookRequestHandler", testSource, provider);
}
Also used : TestRockerModelProvider(io.micronaut.starter.options.TestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider)

Example 14 with TestRockerModelProvider

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

the class AzureRawFunction method applyFunction.

@Override
protected void applyFunction(GeneratorContext generatorContext, ApplicationType type) {
    super.applyFunction(generatorContext, type);
    if (type == ApplicationType.FUNCTION) {
        Project project = generatorContext.getProject();
        String testSource = generatorContext.getTestSourcePath("/{packagePath}/Function");
        TestRockerModelProvider provider = new DefaultTestRockerModelProvider(spockTemplate(project), javaJUnitTemplate(project), groovyJUnitTemplate(project), kotlinJUnitTemplate(project), koTestTemplate(project));
        generatorContext.addTemplate("testFunction", testSource, provider);
    }
}
Also used : Project(io.micronaut.starter.application.Project) TestRockerModelProvider(io.micronaut.starter.options.TestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider) DefaultTestRockerModelProvider(io.micronaut.starter.options.DefaultTestRockerModelProvider)

Example 15 with TestRockerModelProvider

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

the class KotlinApplication method apply.

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