Search in sources :

Example 1 with SwaggerHandler

use of com.networknt.swagger.SwaggerHandler in project light-rest-4j by networknt.

the class ValidatorHandlerTest method setUp.

@Before
public void setUp() {
    if (server == null) {
        logger.info("starting server");
        HttpHandler handler = getPetStoreHandler();
        ValidatorHandler validatorHandler = new ValidatorHandler();
        validatorHandler.setNext(handler);
        handler = validatorHandler;
        BodyHandler bodyHandler = new BodyHandler();
        bodyHandler.setNext(handler);
        handler = bodyHandler;
        SwaggerHandler swaggerHandler = new SwaggerHandler();
        swaggerHandler.setNext(handler);
        handler = swaggerHandler;
        server = Undertow.builder().addHttpListener(8080, "localhost").setHandler(handler).build();
        server.start();
    }
}
Also used : HttpHandler(io.undertow.server.HttpHandler) BodyHandler(com.networknt.body.BodyHandler) SwaggerHandler(com.networknt.swagger.SwaggerHandler) Before(org.junit.Before)

Example 2 with SwaggerHandler

use of com.networknt.swagger.SwaggerHandler in project light-rest-4j by networknt.

the class JwtVerifyHandlerTest method setUp.

@BeforeClass
public static void setUp() {
    if (server == null) {
        logger.info("starting server");
        HttpHandler handler = getTestHandler();
        JwtVerifyHandler jwtVerifyHandler = new JwtVerifyHandler();
        jwtVerifyHandler.setNext(handler);
        SwaggerHandler swaggerHandler = new SwaggerHandler();
        swaggerHandler.setNext(jwtVerifyHandler);
        server = Undertow.builder().addHttpListener(8080, "localhost").setHandler(swaggerHandler).build();
        server.start();
    }
}
Also used : HttpHandler(io.undertow.server.HttpHandler) SwaggerHandler(com.networknt.swagger.SwaggerHandler) BeforeClass(org.junit.BeforeClass)

Aggregations

SwaggerHandler (com.networknt.swagger.SwaggerHandler)2 HttpHandler (io.undertow.server.HttpHandler)2 BodyHandler (com.networknt.body.BodyHandler)1 Before (org.junit.Before)1 BeforeClass (org.junit.BeforeClass)1