use of io.swagger.models.Operation in project swagger-core by swagger-api.
the class ChildTypeTest method testChildTypeParameter.
@Test(description = "Tests schema ref is correctly set up for child type parameter")
public void testChildTypeParameter() {
Operation op = swagger.getPath("/childType/testChildTypeParameter").getPost();
BodyParameter parameter = getBodyParameter(op, 0);
Model schema = parameter.getSchema();
assertEquals(schema.getClass().getName(), RefModel.class.getName());
assertEquals(((RefModel) schema).getSimpleRef(), "Sub1Bean");
}
use of io.swagger.models.Operation in project swagger-core by swagger-api.
the class CollectionFormatTest method readFormParamTest.
@Test(testName = "check collection format for FormParam")
public void readFormParamTest() {
Operation operation = getOperation("testFormParam");
assertEquals(getCollectionFormat(operation, 0), MULTI);
assertNull(getCollectionFormat(operation, 1));
assertEquals(getCollectionFormat(operation, 2), MULTI);
}
use of io.swagger.models.Operation in project swagger-core by swagger-api.
the class CollectionFormatTest method readMixedParamTest.
@Test(testName = "check collection format for Mixed Param")
public void readMixedParamTest() {
Operation operation = getOperation("testMixedParam");
assertEquals(getCollectionFormat(operation, 0), MULTI);
assertEquals(getCollectionFormat(operation, 1), CSV);
assertNull(getCollectionFormat(operation, 2));
assertEquals(getCollectionFormat(operation, 3), CSV);
}
use of io.swagger.models.Operation in project swagger-core by swagger-api.
the class CollectionFormatTest method readCookieParamTest.
@Test(testName = "check collection format for CookieParam")
public void readCookieParamTest() {
Operation operation = getOperation("testCookieParam");
assertEquals(getCollectionFormat(operation, 0), CSV);
assertNull(getCollectionFormat(operation, 1));
assertEquals(getCollectionFormat(operation, 2), CSV);
}
use of io.swagger.models.Operation in project swagger-core by swagger-api.
the class GenericsTest method check2DArrayAsBodyParameter.
@Test(description = "check 2D array as body parameter")
public void check2DArrayAsBodyParameter() {
Operation op = getOperation("test2DInBody");
assertEquals(op.getParameters().size(), 1);
BodyParameter p = getBodyParameter(op, 0);
ArrayModel ddArray = (ArrayModel) p.getSchema();
assertEquals(((RefProperty) ((ArrayProperty) ddArray.getItems()).getItems()).getSimpleRef(), "Tag");
}
Aggregations