List of usage examples for io.netty.handler.codec.http HttpHeaders toString
@Override
public String toString()
From source file:org.kaaproject.kaa.server.transports.http.transport.netty.RequestDecoderTest.java
License:Apache License
private HttpObject createHttpRequestMock(HttpMethod httpMethod, boolean isSuccessfulResult, Class requestClazz) {//from ww w. j a v a 2 s. c o m DecoderResult result = mock(DecoderResult.class); when(result.isSuccess()).thenReturn(isSuccessfulResult); HttpObject httpRequest = (HttpObject) mock(requestClazz); when(httpRequest.getDecoderResult()).thenReturn(result); HttpHeaders headers = mock(HttpHeaders.class); when(headers.toString()).thenReturn("Some header"); if (requestClazz.equals(HttpRequest.class)) { when(((HttpRequest) httpRequest).getMethod()).thenReturn(httpMethod); when(((HttpRequest) httpRequest).headers()).thenReturn(headers); } return httpRequest; }