use of io.servicecomb.swagger.generator.core.unittest.SwaggerGeneratorForTest in project java-chassis by ServiceComb.
the class TestProperty method testStringProperty.
@Test
public void testStringProperty() {
SwaggerGenerator generator = new SwaggerGeneratorForTest(context, null);
List<String> enums = Arrays.asList("testStringProperty_a", "testStringProperty_b");
StringProperty sp = new StringProperty();
sp._enum(enums);
StringPropertyConverter spc = new StringPropertyConverter();
JavaType jt = spc.convert(generator.getClassLoader(), generator.ensureGetPackageName(), generator.getSwagger(), sp);
StringProperty spNew = (StringProperty) ModelConverters.getInstance().readAsProperty(jt);
Assert.assertEquals(enums, spNew.getEnum());
}
Aggregations