use of io.swagger.models.properties.FloatProperty in project swagger-core by swagger-api.
the class FloatPropertyTest method testEquals.
@Test
public void testEquals() {
final FloatProperty prop1 = new FloatProperty();
prop1.setName(PROP_1);
prop1.setRequired(true);
final FloatProperty prop2 = new FloatProperty();
prop2.setName(PROP_2);
assertNotEquals(prop1, prop2);
prop2.setName(PROP_1);
prop2.setRequired(true);
assertEquals(prop1, prop2);
}
use of io.swagger.models.properties.FloatProperty in project swagger-parser by swagger-api.
the class ModelPropertyConverterTest method convertFloatModelProperty.
@Test
public void convertFloatModelProperty() throws Exception {
ModelProperty property = new ModelProperty();
property.setType("number");
property.setFormat(Format.FLOAT);
property.setDescription("a simple float property");
property.setMinimum("1.23");
property.setMaximum("4.56");
Property converted = converter.convertProperty(property);
assertEquals(converted.getClass(), FloatProperty.class);
assertEquals(converted.getType(), "number");
assertEquals(converted.getFormat(), "float");
FloatProperty prop = (FloatProperty) converted;
assertEquals(prop.getMinimum(), new BigDecimal("1.23"));
assertEquals(prop.getMaximum(), new BigDecimal("4.56"));
}
Aggregations