@@ -46,49 +46,6 @@ void dispatch_amendsPath() throws InvalidRequestEventException {
4646 assertEquals ("/srv1/hello" , req .getRequestURI ());
4747 }
4848
49- @ Disabled ("AwsAsyncContext does not sends to servlet anymore" )
50- @ Test
51- void dispatch_sendsToCorrectServlet () {
52- AwsProxyHttpServletRequest req = new AwsProxyHttpServletRequest (new AwsProxyRequestBuilder ("/srv1/hello" , "GET" ).build (), lambdaCtx , null );
53- req .setResponse (handler .getContainerResponse (req , new CountDownLatch (1 )));
54- req .setServletContext (ctx );
55- req .setContainerHandler (handler );
56-
57- AsyncContext asyncCtx = req .startAsync ();
58- handler .setDesiredStatus (201 );
59- asyncCtx .dispatch ();
60- assertNotNull (handler .getSelectedServlet ());
61- assertEquals (srv1 , handler .getSelectedServlet ());
62- assertEquals (201 , handler .getResponse ().getStatus ());
63-
64- req = new AwsProxyHttpServletRequest (new AwsProxyRequestBuilder ("/srv5/hello" , "GET" ).build (), lambdaCtx , null );
65- req .setResponse (handler .getContainerResponse (req , new CountDownLatch (1 )));
66- req .setServletContext (ctx );
67- req .setContainerHandler (handler );
68- asyncCtx = req .startAsync ();
69- handler .setDesiredStatus (202 );
70- asyncCtx .dispatch ();
71- assertNotNull (handler .getSelectedServlet ());
72- assertEquals (srv2 , handler .getSelectedServlet ());
73- assertEquals (202 , handler .getResponse ().getStatus ());
74- }
75-
76- @ Disabled ("AwsAsyncContext does not sends to servlet anymore" )
77- @ Test
78- void dispatchNewPath_sendsToCorrectServlet () throws InvalidRequestEventException {
79- AwsProxyHttpServletRequest req = (AwsProxyHttpServletRequest )reader .readRequest (new AwsProxyRequestBuilder ("/srv1/hello" , "GET" ).build (), null , lambdaCtx , LambdaContainerHandler .getContainerConfig ());
80- req .setResponse (handler .getContainerResponse (req , new CountDownLatch (1 )));
81- req .setServletContext (ctx );
82- req .setContainerHandler (handler );
83-
84- AsyncContext asyncCtx = req .startAsync ();
85- handler .setDesiredStatus (301 );
86- asyncCtx .dispatch ("/srv4/hello" );
87- assertNotNull (handler .getSelectedServlet ());
88- assertEquals (srv2 , handler .getSelectedServlet ());
89- assertNotNull (handler .getResponse ());
90- assertEquals (301 , handler .getResponse ().getStatus ());
91- }
9249
9350 private AwsServletContext getCtx () {
9451 AwsServletContext ctx = new AwsServletContext (handler );
0 commit comments