### Question:
ExtensionlessRequestWrapper extends SlingHttpServletRequestWrapper { public RequestPathInfo getRequestPathInfo() { return new RequestPathInfoWrapper(super.getRequestPathInfo(), super.getResource()); } ExtensionlessRequestWrapper(SlingHttpServletRequest wrappedRequest); RequestPathInfo getRequestPathInfo();  }### Answer:
@Test public void getRequestPathInfo_NullExtension() throws Exception { request.setResource(context.resourceResolver().getResource("/content/null-extension")); MockRequestPathInfo requestPathInfo = (MockRequestPathInfo)request.getRequestPathInfo(); requestPathInfo.setExtension("xyz"); ExtensionlessRequestWrapper wrapper = new ExtensionlessRequestWrapper(request); assertNull(wrapper.getRequestPathInfo().getExtension()); }
@Test public void getRequestPathInfo_HasExtension() throws Exception { request.setResource(context.resourceResolver().getResource("/content/has-extension")); MockRequestPathInfo requestPathInfo = (MockRequestPathInfo)request.getRequestPathInfo(); requestPathInfo.setExtension("xyz"); ExtensionlessRequestWrapper wrapper = new ExtensionlessRequestWrapper(request); assertEquals("xyz", wrapper.getRequestPathInfo().getExtension()); }
@Test public void passThroughMethods() throws Exception { context.requestPathInfo().setResourcePath("/content"); context.requestPathInfo().setSelectorString("bar"); context.requestPathInfo().setExtension("html"); context.requestPathInfo().setSuffix("/xyz"); context.request().setResource(context.resourceResolver().getResource("/content")); ExtensionlessRequestWrapper wrapper = new ExtensionlessRequestWrapper(context.request()); assertEquals("/content", wrapper.getRequestPathInfo().getResourcePath()); assertEquals("bar", wrapper.getRequestPathInfo().getSelectorString()); assertEquals("html", wrapper.getRequestPathInfo().getExtension()); assertEquals("/xyz", wrapper.getRequestPathInfo().getSuffix()); }