Search in sources :

Example 1 with SetHeaderHandler

use of io.undertow.server.handlers.SetHeaderHandler in project undertow by undertow-io.

the class PredicatedHandlersParserTestCase method testParsedHandler2.

@Test
public void testParsedHandler2() {
    String value = "header(header=a, value='a%%lb')";
    List<PredicatedHandler> ret = PredicatedHandlersParser.parse(value, getClass().getClassLoader());
    Assert.assertEquals(1, ret.size());
    SetHeaderHandler handler = (SetHeaderHandler) ret.get(0).getHandler().wrap(ResponseCodeHandler.HANDLE_200);
    Assert.assertEquals("a", handler.getHeader().toString());
    Assert.assertEquals("a%lb", handler.getValue().readAttribute(null));
}
Also used : SetHeaderHandler(io.undertow.server.handlers.SetHeaderHandler) HttpString(io.undertow.util.HttpString) UnitTest(io.undertow.testutils.category.UnitTest) Test(org.junit.Test)

Aggregations

SetHeaderHandler (io.undertow.server.handlers.SetHeaderHandler)1 UnitTest (io.undertow.testutils.category.UnitTest)1 HttpString (io.undertow.util.HttpString)1 Test (org.junit.Test)1