Search in sources :

Example 31 with RequestHandlerManager

use of com.tvd12.ezyhttp.server.core.manager.RequestHandlerManager in project ezyhttp by youngmonkeys.

the class RequestHandlersImplementerTest method implementOneAllowOverrideURI.

@Test
public void implementOneAllowOverrideURI() {
    // given
    RequestHandlersImplementer sut = new RequestHandlersImplementer();
    Controller controller = new Controller();
    RequestHandlerManager manager = new RequestHandlerManager();
    manager.setAllowOverrideURI(true);
    // when
    manager.addHandlers(sut.implement(Collections.singletonList(controller)));
    // then
    RequestURI uri = new RequestURI(HttpMethod.GET, "/get", false);
    Asserts.assertThat(manager.getHandlerListByURI().get(uri).size()).isEqualsTo(2);
}
Also used : RequestHandlersImplementer(com.tvd12.ezyhttp.server.core.asm.RequestHandlersImplementer) RequestHandlerManager(com.tvd12.ezyhttp.server.core.manager.RequestHandlerManager) RequestURI(com.tvd12.ezyhttp.server.core.request.RequestURI) Test(org.testng.annotations.Test)

Aggregations

RequestHandlerManager (com.tvd12.ezyhttp.server.core.manager.RequestHandlerManager)30 Test (org.testng.annotations.Test)30 RequestURI (com.tvd12.ezyhttp.server.core.request.RequestURI)27 ComponentManager (com.tvd12.ezyhttp.server.core.manager.ComponentManager)24 BlockingServlet (com.tvd12.ezyhttp.server.core.servlet.BlockingServlet)24 HttpServletRequest (javax.servlet.http.HttpServletRequest)24 HttpServletResponse (javax.servlet.http.HttpServletResponse)24 ToString (lombok.ToString)24 ServletOutputStream (javax.servlet.ServletOutputStream)22 RequestCookie (com.tvd12.ezyhttp.server.core.annotation.RequestCookie)20 Cookie (javax.servlet.http.Cookie)20 RequestInterceptor (com.tvd12.ezyhttp.server.core.interceptor.RequestInterceptor)10 BodySerializer (com.tvd12.ezyhttp.core.codec.BodySerializer)4 DataConverters (com.tvd12.ezyhttp.core.codec.DataConverters)4 RequestHandlersImplementer (com.tvd12.ezyhttp.server.core.asm.RequestHandlersImplementer)4 ExceptionHandlerManager (com.tvd12.ezyhttp.server.core.manager.ExceptionHandlerManager)4 UnhandledErrorHandler (com.tvd12.ezyhttp.server.core.handler.UnhandledErrorHandler)3 EzyWrap (com.tvd12.ezyfox.util.EzyWrap)2 ResponseEntity (com.tvd12.ezyhttp.core.response.ResponseEntity)2 RequestResponseWatcher (com.tvd12.ezyhttp.server.core.handler.RequestResponseWatcher)2