use of com.github.jcustenborder.kafka.connect.utils.templates.TransformationTemplate in project connect-utils by jcustenborder.
the class BaseDocumentationTest method transformRstTest.
DynamicTest transformRstTest(TransformationTemplate transformationTemplate, final String templateName, final File parentDirectory) {
if (!parentDirectory.isDirectory()) {
parentDirectory.mkdirs();
}
final String testName = transformationTemplate.getTestName();
return dynamicTest(testName, () -> {
final File outputFile = new File(parentDirectory, testName.toLowerCase() + ".rst");
Template template = configuration.getTemplate(templateName);
log.info("Writing {}", outputFile);
try (Writer writer = Files.newWriter(outputFile, Charsets.UTF_8)) {
process(writer, template, transformationTemplate);
}
});
}
Aggregations