added test case to validate the existing regex rewrite rule as wired up
This commit is contained in:
parent
6108d0df0c
commit
b5fd095055
|
@ -77,6 +77,20 @@ public class RewriteHandlerTest extends AbstractRuleTestCase
|
|||
@Test
|
||||
public void test() throws Exception
|
||||
{
|
||||
_response.setStatus(200);
|
||||
_request.setHandled(false);
|
||||
_handler.setOriginalPathAttribute("/before");
|
||||
_handler.setRewriteRequestURI(true);
|
||||
_handler.setRewritePathInfo(true);
|
||||
_request.setRequestURI("/xxx/bar");
|
||||
_request.setPathInfo("/xxx/bar");
|
||||
_handler.handle("/xxx/bar",_request,_request, _response);
|
||||
assertEquals(201,_response.getStatus());
|
||||
assertEquals("/bar/zzz",_request.getAttribute("target"));
|
||||
assertEquals("/bar/zzz",_request.getAttribute("URI"));
|
||||
assertEquals("/bar/zzz",_request.getAttribute("info"));
|
||||
assertEquals(null,_request.getAttribute("before"));
|
||||
|
||||
_response.setStatus(200);
|
||||
_request.setHandled(false);
|
||||
_handler.setOriginalPathAttribute("/before");
|
||||
|
|
Loading…
Reference in New Issue