use of org.webpieces.httpparser.impl.ConvertAscii in project webpieces by deanhiller.
the class TestRequestParsing method testAsciiConverter.
@Test
public void testAsciiConverter() {
HttpRequest request = createPostRequest();
byte[] payload = unwrap(parser.marshalToByteBuffer(state, request));
ConvertAscii converter = new ConvertAscii();
String readableForm = converter.convertToReadableForm(payload);
String expected = "POST\\s http://myhost.com\\s HTTP/1.1\\r\\n\r\n" + "Accept:\\s CooolValue\\r\\n\r\n" + "CustomerHEADER:\\s betterValue\\r\\n\r\n" + "\\r\\n\r\n";
Assert.assertEquals(expected, readableForm);
}
use of org.webpieces.httpparser.impl.ConvertAscii in project webpieces by deanhiller.
the class TestResponseParsing method testAsciiConverter.
@Test
public void testAsciiConverter() {
HttpResponse response = createOkResponse();
byte[] payload = unwrap(parser.marshalToByteBuffer(state, response));
ConvertAscii converter = new ConvertAscii();
String readableForm = converter.convertToReadableForm(payload);
Assert.assertEquals("HTTP/1.1\\s 200\\s OK\\r\\n\r\n" + "Accept:\\s CooolValue\\r\\n\r\n" + "CustomerHEADER:\\s betterValue\\r\\n\r\n" + "\\r\\n\r\n", readableForm);
}
Aggregations