use of io.apicurio.datamodels.core.models.Document in project syndesis by syndesisio.
the class ProjectDSLGeneratorTest method testGenerateRestDSL.
// ***************************
// Tests
// ***************************
@Test
public void testGenerateRestDSL() throws Exception {
final InputStream is = this.getClass().getResourceAsStream("/io/syndesis/server/runtime/task-api.json");
byte[] openApiBytes = IOUtils.toByteArray(is);
final Document openApiDoc = Library.readDocumentFromJSONString(new String(openApiBytes, StandardCharsets.UTF_8));
final StringBuilder code = new StringBuilder();
RestDslGenerator.toAppendable((OasDocument) openApiDoc).withClassName("RestRoute").withPackageName("io.syndesis.example").withoutSourceCodeTimestamps().generate(code);
Assert.assertTrue(code.length() > 0);
}
Aggregations