use of io.swagger.models.properties.BooleanProperty in project swagger-core by swagger-api.
the class BooleanPropertyTest method testEquals.
@Test
public void testEquals() {
final BooleanProperty prop1 = new BooleanProperty();
prop1.setName(PROP_1);
prop1.setRequired(true);
final BooleanProperty prop2 = new BooleanProperty();
prop2.setName(PROP_2);
assertNotEquals(prop1, prop2);
prop2.setName(PROP_1);
prop2.setRequired(true);
assertEquals(prop1, prop2);
}
use of io.swagger.models.properties.BooleanProperty in project swagger-core by swagger-api.
the class ModelPropertyTest method testIssue1743.
@Test
public void testIssue1743() {
final Map<String, Model> models = ModelConverters.getInstance().readAll(ModelWithBooleanProperty.class);
final Model model = models.get("ModelWithBooleanProperty");
assertNotNull(model);
BooleanProperty bp = (BooleanProperty) model.getProperties().get("isGreat");
assertTrue(bp.getEnum().size() == 1);
assertEquals(bp.getEnum().get(0), Boolean.TRUE);
}
use of io.swagger.models.properties.BooleanProperty in project swagger-core by swagger-api.
the class ResponseTest method testHeader.
@Test
public void testHeader() {
// given
Response response = new Response();
String name = "name";
Property property = new BooleanProperty();
// when
response.header(name, property);
// then
assertEquals(response.getHeaders().get("name"), property, "The retrieved property must be the same as the set one");
}
use of io.swagger.models.properties.BooleanProperty in project swagger-core by swagger-api.
the class AbstractSerializableParameterTest method testGetDefaultWithBooleanProperty.
@Test
public void testGetDefaultWithBooleanProperty() {
// given
instance.setProperty(new BooleanProperty());
defaultValue = true;
// when
instance.setDefault(defaultValue);
// then
assertEquals(instance.getDefault(), true, "The get default must be the same as the set one");
}
use of io.swagger.models.properties.BooleanProperty in project swagger-core by swagger-api.
the class AbstractSerializableParameterTest method testGetExampleWithBooleanProperty.
@Test
public void testGetExampleWithBooleanProperty() {
// given
instance.setProperty(new BooleanProperty());
example = "true";
// when
instance.setExample(example);
assertEquals(instance.getExample(), true, "The get example must be the same as the set one");
}
Aggregations