Package org.mockserver.proxy.filters

Examples of org.mockserver.proxy.filters.ProxyResponseFilter


    @Test
    public void shouldApplyFiltersBeforeAndAfterRequest() throws Exception {
        // given
        // - add first filter
        ProxyResponseFilter filter = mock(ProxyResponseFilter.class);
        when(filter.onResponse(any(HttpRequest.class), any(HttpResponse.class))).thenReturn(new HttpResponse());
        proxyServlet.withFilter(httpRequest, filter);
        // - add first filter with other request
        HttpRequest someOtherRequest = new HttpRequest().withPath("some_other_path");
        proxyServlet.withFilter(someOtherRequest, filter);
        // - add second filter
        ProxyResponseFilter someOtherFilter = mock(ProxyResponseFilter.class);
        proxyServlet.withFilter(someOtherRequest, someOtherFilter);

        // when
        proxyServlet.doGet(mockHttpServletRequest, mockHttpServletResponse);
View Full Code Here

TOP

Related Classes of org.mockserver.proxy.filters.ProxyResponseFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.