Search in sources :

Example 11 with HttpChunk

use of org.webpieces.httpparser.api.dto.HttpChunk in project webpieces by deanhiller.

the class TestGooglePlayback method testGooglePlayback.

@Test
public void testGooglePlayback() {
    List<HttpPayload> results = runPlayback("google.com.11015.recording");
    Assert.assertEquals(3, results.size());
    HttpResponse resp = (HttpResponse) results.get(0);
    HttpChunk chunk = (HttpChunk) results.get(1);
    HttpLastChunk lastChunk = (HttpLastChunk) results.get(2);
    Assert.assertEquals("chunked", resp.getHeaderLookupStruct().getHeader(KnownHeaderName.TRANSFER_ENCODING).getValue());
    Assert.assertEquals(10349, chunk.getBody().getReadableSize());
    Assert.assertTrue(lastChunk.isEndOfData());
}
Also used : HttpLastChunk(org.webpieces.httpparser.api.dto.HttpLastChunk) HttpPayload(org.webpieces.httpparser.api.dto.HttpPayload) HttpResponse(org.webpieces.httpparser.api.dto.HttpResponse) HttpChunk(org.webpieces.httpparser.api.dto.HttpChunk) Test(org.junit.Test)

Aggregations

HttpChunk (org.webpieces.httpparser.api.dto.HttpChunk)11 Test (org.junit.Test)7 DataWrapper (org.webpieces.data.api.DataWrapper)7 Header (org.webpieces.httpparser.api.common.Header)6 HttpLastChunk (org.webpieces.httpparser.api.dto.HttpLastChunk)6 HttpPayload (org.webpieces.httpparser.api.dto.HttpPayload)5 HttpResponse (org.webpieces.httpparser.api.dto.HttpResponse)5 DataFrame (com.webpieces.http2parser.api.dto.DataFrame)2 PassedIn (org.webpieces.httpfrontend2.api.mock2.MockHttp2RequestListener.PassedIn)2 HttpChunkExtension (org.webpieces.httpparser.api.dto.HttpChunkExtension)2 HttpRequest (org.webpieces.httpparser.api.dto.HttpRequest)2 Http2Response (com.webpieces.hpack.api.dto.Http2Response)1 StreamWriter (com.webpieces.http2engine.api.StreamWriter)1 ArrayList (java.util.ArrayList)1 HttpMessage (org.webpieces.httpparser.api.dto.HttpMessage)1