Search in sources :

Example 1 with ZuulMessageImpl

use of com.netflix.zuul.message.ZuulMessageImpl in project zuul by Netflix.

the class HttpUtilsTest method getBodySizeIfKnown_returnsContentLengthValue.

@Test
public void getBodySizeIfKnown_returnsContentLengthValue() {
    SessionContext context = new SessionContext();
    Headers headers = new Headers();
    headers.add(com.netflix.zuul.message.http.HttpHeaderNames.CONTENT_LENGTH, "23450");
    ZuulMessage msg = new ZuulMessageImpl(context, headers);
    assertThat(HttpUtils.getBodySizeIfKnown(msg)).isEqualTo(Integer.valueOf(23450));
}
Also used : ZuulMessage(com.netflix.zuul.message.ZuulMessage) Headers(com.netflix.zuul.message.Headers) SessionContext(com.netflix.zuul.context.SessionContext) ZuulMessageImpl(com.netflix.zuul.message.ZuulMessageImpl) Test(org.junit.Test)

Example 2 with ZuulMessageImpl

use of com.netflix.zuul.message.ZuulMessageImpl in project zuul by Netflix.

the class HttpUtilsTest method getBodySizeIfKnown_returnsNull.

@Test
public void getBodySizeIfKnown_returnsNull() {
    SessionContext context = new SessionContext();
    Headers headers = new Headers();
    ZuulMessage msg = new ZuulMessageImpl(context, headers);
    assertThat(HttpUtils.getBodySizeIfKnown(msg)).isNull();
}
Also used : ZuulMessage(com.netflix.zuul.message.ZuulMessage) Headers(com.netflix.zuul.message.Headers) SessionContext(com.netflix.zuul.context.SessionContext) ZuulMessageImpl(com.netflix.zuul.message.ZuulMessageImpl) Test(org.junit.Test)

Aggregations

SessionContext (com.netflix.zuul.context.SessionContext)2 Headers (com.netflix.zuul.message.Headers)2 ZuulMessage (com.netflix.zuul.message.ZuulMessage)2 ZuulMessageImpl (com.netflix.zuul.message.ZuulMessageImpl)2 Test (org.junit.Test)2