### Question:
AssetRenditionServlet extends SlingSafeMethodsServlet { protected void setResponseHeaders(final SlingHttpServletResponse response, final AssetRenditionParameters parameters) { if (parameters.isDownload()) { response.setHeader("Content-Disposition", String.format("attachment; filename=%s", parameters.getFileName())); } else { response.setHeader("Content-Disposition", String.format("filename=%s", parameters.getFileName())); } }  final void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response); static final String SERVLET_EXTENSION; }### Answer:
@Test public void setResponseHeaders() { ctx.requestPathInfo().setResourcePath("/content/dam/test.png"); ctx.requestPathInfo().setExtension("rendition"); ctx.requestPathInfo().setSuffix("testing/asset.rendition"); final AssetRenditionParameters params = new AssetRenditionParameters(ctx.request()); new AssetRenditionServlet().setResponseHeaders(ctx.response(), params); assertEquals("filename=test.testing.png", ctx.response().getHeader("Content-Disposition")); }
@Test public void setResponseHeaders_AsAttachment() { ctx.requestPathInfo().setResourcePath("/content/dam/test.png"); ctx.requestPathInfo().setExtension("rendition"); ctx.requestPathInfo().setSuffix("testing/download/asset.rendition"); final AssetRenditionParameters params = new AssetRenditionParameters(ctx.request()); new AssetRenditionServlet().setResponseHeaders(ctx.response(), params); assertEquals("attachment; filename=test.testing.png", ctx.response().getHeader("Content-Disposition")); }