Module: generator-template¶
generator-template provides the template generator: Mustache-based code generation for source-code tests (Java/Kotlin).
It is contributed as an explicit feature module (TemplateGeneratorModule) rather than being built-in to core.
Depends on¶
core
Used by¶
distribution-bundle(enabled by default viaDistributionDefaults)
Key types¶
TemplateGeneratorModule:TestGenerationModulethat registers thetemplategeneratorTemplateArtifactGenerator(internal): renders templates and writes files
Configuration¶
See:
- How-to: Template generator
- How-to: Custom templates
- Reference: Generator options
Scope and responsibilities (contributors)¶
generator-template provides Mustache-based code generation for test suites. It contributes a single generator id template and loads templates from generator-template/src/main/resources/templates.
Key types¶
TemplateGeneratorModule¶
TemplateGeneratorModule implements TestGenerationModule and registers the template generator via TemplateArtifactGeneratorFactory.
TemplateArtifactGenerator¶
TemplateArtifactGenerator:
- Renders test classes and methods from Mustache templates.
- Derives
classNamefromoperationName(operationId) or from HTTP method + path when missing, then normalizes it into a valid identifier. - Writes output files using
outputFileNamePattern. - Supports custom template directories via
customTemplateDir. - Uses
templateVariablesto pass user-defined values into templates.
Templates¶
Built-in template sets:
restassured-javarestassured-kotlin
Each set provides a class.mustache and method.mustache template.
API reference¶
- Dokka API reference:
docs/api/generator-template/index.html
Related docs¶
- Core module: core
- How-to: Template generator