@Test
  public void emptyBlobRangeHandlingTest() throws Exception {
    Account refAccount = ACCOUNT_SERVICE.createAndAddRandomAccount();
    Container refContainer = refAccount.getContainerById(Container.DEFAULT_PUBLIC_CONTAINER_ID);
    HttpHeaders headers = new DefaultHttpHeaders();
    setAmbryHeadersForPut(headers, TTL_SECS, !refContainer.isCacheable(), refAccount.getName(),
        "application/octet-stream", null, refAccount.getName(), refContainer.getName());
    ByteBuffer content = ByteBuffer.allocate(0);
    String blobId = postBlobAndVerify(headers, content, content.capacity());
    ByteRange range = ByteRanges.fromOffsetRange(0, 50);
    headers.add(RestUtils.Headers.BLOB_SIZE, content.capacity());
    headers.add(RestUtils.Headers.LIFE_VERSION, "0");

    // Should get a 416 if x-ambry-resolve-range-on-empty-blob is not set
    HttpRequest httpRequest = buildRequest(HttpMethod.GET, blobId,
        new DefaultHttpHeaders().add(RestUtils.Headers.RANGE, RestTestUtils.getRangeHeaderString(range)), null);
    ResponseParts responseParts = nettyClient.sendRequest(httpRequest, null, null).get();
    HttpResponse response = getHttpResponse(responseParts);
    assertEquals("Unexpected response status", HttpResponseStatus.REQUESTED_RANGE_NOT_SATISFIABLE, response.status());

    // Should get a 206 if the header is set.
    getBlobAndVerify(blobId, range, null, true, headers, !refContainer.isCacheable(), content, refAccount.getName(),
        refContainer.getName(), refContainer);
  }
Tests for the account/container get/update API.
ambry-frontend/src/integration-test/java/com/github/ambry/frontend/FrontendIntegrationTest.java