use of io.micronaut.starter.options.DefaultTestRockerModelProvider 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);
}
use of io.micronaut.starter.options.DefaultTestRockerModelProvider 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);
}
use of io.micronaut.starter.options.DefaultTestRockerModelProvider 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);
}
}
use of io.micronaut.starter.options.DefaultTestRockerModelProvider 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)));
}
}
use of io.micronaut.starter.options.DefaultTestRockerModelProvider 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)));
}
}
Aggregations