Package ro.isdc.wro.http.support

Examples of ro.isdc.wro.http.support.DelegatingServletInputStream


  public void setUp()
      throws Exception {
    victim = new GzipFilter();
    MockitoAnnotations.initMocks(this);
    when(mockRequest.getInputStream()).thenReturn(
        new DelegatingServletInputStream(new ByteArrayInputStream("".getBytes())));
    when(mockResponse.getOutputStream()).thenReturn(new DelegatingServletOutputStream(new NullOutputStream()));
    // mock chaining
    Mockito.doAnswer(new Answer<Void>() {
      public Void answer(final InvocationOnMock invocation)
          throws Throwable {
View Full Code Here


    markGzipAsAllowed();
    final String content = "sampleContent";
    final InputStream sourceStream = new ByteArrayInputStream(content.getBytes());
    final ByteArrayOutputStream targetStream = new ByteArrayOutputStream();
   
    when(mockRequest.getInputStream()).thenReturn(new DelegatingServletInputStream(sourceStream));
    when(mockResponse.getOutputStream()).thenReturn(new DelegatingServletOutputStream(targetStream));
   
    victim.doFilter(mockRequest, mockResponse, mockFilterChain);
   
    // not the same response is chained
View Full Code Here

TOP

Related Classes of ro.isdc.wro.http.support.DelegatingServletInputStream

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.