use of io.swagger.models.ModelWithEnumProperty in project swagger-core by swagger-api.
the class EnumPropertyTest method testExtractEnumReturnType.
@Test(description = "it should extract enum values from method return types")
public void testExtractEnumReturnType() {
final Map<String, Model> models = ModelConverters.getInstance().read(ModelWithEnumProperty.class);
final Model model = models.get("ModelWithEnumProperty");
final Property enumProperty = model.getProperties().get("enumValue");
assertTrue(enumProperty instanceof StringProperty);
final StringProperty stringProperty = (StringProperty) enumProperty;
assertEquals(stringProperty.getEnum(), Arrays.asList("PRIVATE", "PUBLIC", "SYSTEM", "INVITE_ONLY"));
}
Aggregations