use of io.swagger.servlet.ReaderContext in project swagger-core by swagger-api.
the class CheckReadableApiTest method createContext.
private static ReaderContext createContext(Class<?> cls, boolean readHidden) {
final ReaderContext context = createContext(cls);
context.setReadHidden(readHidden);
return context;
}
use of io.swagger.servlet.ReaderContext in project swagger-core by swagger-api.
the class ConsumesProducesTest method applyConsumesProducesTest1.
@Test(dataProvider = "resourceWithAnnotations")
public void applyConsumesProducesTest1(String methodName, List<String> expected) throws NoSuchMethodException {
final Operation operation = new Operation();
final ReaderContext context = createDefaultContext();
final Method method = findMethod(context, methodName);
extension.applyConsumes(context, operation, method);
extension.applyProduces(context, operation, method);
Assert.assertEquals(operation.getConsumes(), expected);
Assert.assertEquals(operation.getProduces(), expected);
}
use of io.swagger.servlet.ReaderContext in project swagger-core by swagger-api.
the class HttpMethodGetterTest method getHttpMethodTest.
@Test(dataProvider = "resources")
public void getHttpMethodTest(String methodName, String expected) throws NoSuchMethodException {
final ReaderContext context = createDefaultContext();
Assert.assertEquals(extension.getHttpMethod(context, findMethod(context, methodName)), expected);
}
use of io.swagger.servlet.ReaderContext in project swagger-core by swagger-api.
the class ImplicitParametersTest method applyImplicitParametersTest.
@Test(dataProvider = "resourceWithAnnotations")
public void applyImplicitParametersTest(String methodName, int expected) throws NoSuchMethodException {
final Operation operation = new Operation();
final ReaderContext context = createDefaultContext();
extension.applyImplicitParameters(context, operation, findMethod(context, methodName));
Assert.assertEquals(operation.getParameters().size(), expected);
}
use of io.swagger.servlet.ReaderContext in project swagger-core by swagger-api.
the class PathGetterTest method getPathWithoutApiTest.
@Test(dataProvider = "resourceWithoutApiAnnotation")
public void getPathWithoutApiTest(String methodName, String expected) throws NoSuchMethodException {
final ReaderContext context = createDefaultContextWithoutApi();
context.setParentPath("/tests");
Assert.assertEquals(extension.getPath(context, findMethod(context, methodName)), expected);
}
Aggregations