@Test public void getAttribute() { final SlingHttpServletRequest request = new AssetRenditionDownloadRequest( ctx.request(), "GET", resource, new String[]{}, "html", "/my/suffix"); SlingBindings actual = (SlingBindings) request.getAttribute(SlingBindings.class.getName()); assertEquals(resource, actual.get(SlingBindings.RESOURCE)); assertEquals(ctx.resourceResolver(), actual.get(SlingBindings.RESOLVER)); assertNull(actual.get("not-sling-bindings")); }
@Override public Object getAttribute(String name) { if (SlingBindings.class.getName().equals(name)) { return bindings; } else { return super.getAttribute(name); } }
AssetRenditionDownloadRequest extends SlingHttpServletRequestWrapper { @Override public Object getAttribute(String name) { if (SlingBindings.class.getName().equals(name)) { return bindings; } else { return super.getAttribute(name); } } }
AssetRenditionDownloadRequest extends SlingHttpServletRequestWrapper { @Override public Object getAttribute(String name) { if (SlingBindings.class.getName().equals(name)) { return bindings; } else { return super.getAttribute(name); } } AssetRenditionDownloadRequest(final SlingHttpServletRequest wrappedRequest,
                                         final String method,
                                         final Resource resource,
                                         final String[] selectors,
                                         final String extension,
                                         final String suffix); }
AssetRenditionDownloadRequest extends SlingHttpServletRequestWrapper { @Override public Object getAttribute(String name) { if (SlingBindings.class.getName().equals(name)) { return bindings; } else { return super.getAttribute(name); } } AssetRenditionDownloadRequest(final SlingHttpServletRequest wrappedRequest,
                                         final String method,
                                         final Resource resource,
                                         final String[] selectors,
                                         final String extension,
                                         final String suffix); @Override Object getAttribute(String name); @Override Resource getResource(); @Override String getMethod(); @Override RequestPathInfo getRequestPathInfo(); }
AssetRenditionDownloadRequest extends SlingHttpServletRequestWrapper { @Override public Object getAttribute(String name) { if (SlingBindings.class.getName().equals(name)) { return bindings; } else { return super.getAttribute(name); } } AssetRenditionDownloadRequest(final SlingHttpServletRequest wrappedRequest,
                                         final String method,
                                         final Resource resource,
                                         final String[] selectors,
                                         final String extension,
                                         final String suffix); @Override Object getAttribute(String name); @Override Resource getResource(); @Override String getMethod(); @Override RequestPathInfo getRequestPathInfo();  }