use of cz.habarta.typescript.generator.TypeProcessor in project typescript-generator by vojtechhabarta.
the class BeanPropertyPathExtensionTest method basicTest.
@Test
public void basicTest() throws Exception {
final StringBuilder data = new StringBuilder();
final EmitterExtension.Writer writer = new EmitterExtension.Writer() {
@Override
public void writeIndentedLine(String line) {
data.append(line + "\n");
}
};
final Settings settings = new Settings();
settings.sortDeclarations = true;
final TypeProcessor typeProcessor = new DefaultTypeProcessor();
final Model model = new Jackson2Parser(settings, typeProcessor).parseModel(ClassA.class);
final TsModel tsModel = new ModelCompiler(settings, typeProcessor).javaToTypeScript(model);
new BeanPropertyPathExtension().emitElements(writer, settings, false, tsModel);
String dataStr = data.toString();
final String expected = Utils.readString(getClass().getResourceAsStream("/ext/expected.ts"), "\n");
Assert.assertEquals(expected.trim(), dataStr.trim());
}
Aggregations