@Test public void sizeTest() throws RestServiceException { NettyRequest nettyRequest = createNettyRequest(HttpMethod.GET, "/", null, new MockChannel()); assertEquals("Size not as expected", -1, nettyRequest.getSize()); int xAmbryBlobSize = 20; int contentLength = 10; HttpHeaders headers = new DefaultHttpHeaders(); headers.add(HttpHeaderNames.CONTENT_LENGTH, contentLength); nettyRequest = createNettyRequest(HttpMethod.GET, "/", headers, new MockChannel()); assertEquals("Size not as expected", contentLength, nettyRequest.getSize()); headers = new DefaultHttpHeaders(); headers.add(RestUtils.Headers.BLOB_SIZE, xAmbryBlobSize); nettyRequest = createNettyRequest(HttpMethod.GET, "/", headers, new MockChannel()); assertEquals("Size not as expected", xAmbryBlobSize, nettyRequest.getSize()); headers = new DefaultHttpHeaders(); headers.add(RestUtils.Headers.BLOB_SIZE, xAmbryBlobSize); headers.add(HttpHeaderNames.CONTENT_LENGTH, contentLength); nettyRequest = createNettyRequest(HttpMethod.GET, "/", headers, new MockChannel()); assertEquals("Size not as expected", xAmbryBlobSize, nettyRequest.getSize()); }
@Override public long getSize() { return size; }
NettyRequest implements RestRequest { @Override public long getSize() { return size; } }
NettyRequest implements RestRequest { @Override public long getSize() { return size; } NettyRequest(HttpRequest request, Channel channel, NettyMetrics nettyMetrics,
      Set<String> blacklistedQueryParams); }
NettyRequest implements RestRequest { @Override public long getSize() { return size; } NettyRequest(HttpRequest request, Channel channel, NettyMetrics nettyMetrics,
      Set<String> blacklistedQueryParams); @Override String getUri(); @Override String getPath(); @Override RestMethod getRestMethod(); @Override Map<String, Object> getArgs(); @Override Object setArg(String key, Object value); @Override SSLSession getSSLSession(); @Override void prepare(); @Override boolean isOpen(); @Override void close(); @Override RestRequestMetricsTracker getMetricsTracker(); @Override String toString(); @Override long getSize(); @Override Future<Long> readInto(AsyncWritableChannel asyncWritableChannel, Callback<Long> callback); @Override void setDigestAlgorithm(String digestAlgorithm); @Override byte[] getDigest(); @Override long getBytesReceived(); @Override long getBlobBytesReceived(); @Override NettyRequestContext getRestRequestContext(); }
NettyRequest implements RestRequest { @Override public long getSize() { return size; } NettyRequest(HttpRequest request, Channel channel, NettyMetrics nettyMetrics,
      Set<String> blacklistedQueryParams); @Override String getUri(); @Override String getPath(); @Override RestMethod getRestMethod(); @Override Map<String, Object> getArgs(); @Override Object setArg(String key, Object value); @Override SSLSession getSSLSession(); @Override void prepare(); @Override boolean isOpen(); @Override void close(); @Override RestRequestMetricsTracker getMetricsTracker(); @Override String toString(); @Override long getSize(); @Override Future<Long> readInto(AsyncWritableChannel asyncWritableChannel, Callback<Long> callback); @Override void setDigestAlgorithm(String digestAlgorithm); @Override byte[] getDigest(); @Override long getBytesReceived(); @Override long getBlobBytesReceived(); @Override NettyRequestContext getRestRequestContext();  }