@Override
  public void interceptResponse(HttpResponse response) throws IOException {
    if (!LOG.isDebugEnabled()) {
      return;
    }
    String uploadId = response.getHeaders().getFirstHeaderStringValue(UPLOAD_HEADER);
    if (uploadId == null) {
      return;
    }

    GenericUrl url = response.getRequest().getUrl();
    // The check for no upload id limits the output to one log line per upload.
    // The check for upload type makes sure this is an upload and not a read.
    if (url.get(UPLOAD_ID_PARAM) == null && url.get(UPLOAD_TYPE_PARAM) != null) {
      LOG.debug(
          "Upload ID for url {} on worker {} is {}",
          url,
          System.getProperty("worker_id"),
          uploadId);
    }
  }
@Test
  public void testResponseLogs() throws IOException {
    new UploadIdResponseInterceptor().interceptResponse(buildHttpResponse("abc", null, "type"));
    GenericUrl url = new GenericUrl(HttpTesting.SIMPLE_URL);
    url.put("uploadType", "type");
    String worker = System.getProperty("worker_id");
    expectedLogs.verifyDebug("Upload ID for url " + url + " on worker " + worker + " is abc");
  }