private void verifyCacheHeaders(Container container, MockRestResponseChannel restResponseChannel) {
    if (container.isCacheable()) {
      long cacheTtl = container.getCacheTtlInSecond() != null ? container.getCacheTtlInSecond().longValue()
          : FRONTEND_CONFIG.cacheValiditySeconds;
      Assert.assertTrue("Expires value should be in the future",
          RestUtils.getTimeFromDateString(restResponseChannel.getHeader(RestUtils.Headers.EXPIRES))
              > System.currentTimeMillis());
      Assert.assertEquals("Cache-Control value not as expected", "max-age=" + cacheTtl,
          restResponseChannel.getHeader(RestUtils.Headers.CACHE_CONTROL));
      Assert.assertNull("Pragma value should not have been set",
          restResponseChannel.getHeader(RestUtils.Headers.PRAGMA));
    } else {
      Assert.assertEquals("Expires value is incorrect for non-cacheable blob",
          restResponseChannel.getHeader(RestUtils.Headers.DATE),
          restResponseChannel.getHeader(RestUtils.Headers.EXPIRES));
      Assert.assertEquals("Cache-Control value not as expected", "private, no-cache, no-store, proxy-revalidate",
          restResponseChannel.getHeader(RestUtils.Headers.CACHE_CONTROL));
      Assert.assertEquals("Pragma value not as expected", "no-cache",
          restResponseChannel.getHeader(RestUtils.Headers.PRAGMA));
    }
  }
Verifies that the right cache headers are returned.
@param container the {@link Container}.
@param restResponseChannel the {@link RestResponseChannel} over which the response is sent.
ambry-frontend/src/test/java/com/github/ambry/frontend/AmbrySecurityServiceTest.java