Search in sources :

Example 1 with BodyHandler

use of com.networknt.body.BodyHandler 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;
        OpenApiHandler openApiHandler = new OpenApiHandler();
        openApiHandler.setNext(handler);
        handler = openApiHandler;
        server = Undertow.builder().addHttpListener(8080, "localhost").setHandler(handler).build();
        server.start();
    }
}
Also used : HttpHandler(io.undertow.server.HttpHandler) BodyHandler(com.networknt.body.BodyHandler) Before(org.junit.Before)

Example 2 with BodyHandler

use of com.networknt.body.BodyHandler 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 3 with BodyHandler

use of com.networknt.body.BodyHandler in project light-4j by networknt.

the class SanitizerHandlerTest method setUp.

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

Aggregations

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