RequestLookup { public String getContextPath() { return contextPath; } RequestLookup(String contextPath, HttpRequest request, HttpResponse response); String getContextPath(); HttpRequest getRequest(); HttpResponse getResponse(); Map<String, String> getPathParams(); void addToPlaceholder(Placeholder placeholder, String content); Optional<String> getPlaceholderContent(Placeholder placeholder); Map<String, String> getPlaceholderContents(); void putToZone(String zoneName, String content); Optional<String> getZoneContent(String zoneName); String getPublicUri(); RenderingFlowTracker tracker();  }
@Test public void testContextPath() { RequestLookup requestLookup = new RequestLookup("/test1", null, null); Assert.assertEquals(requestLookup.getContextPath(), "/test1"); HttpRequest request = mock(HttpRequest.class); when(request.getContextPath()).thenReturn("/test2"); requestLookup = new RequestLookup(null, request, null); Assert.assertEquals(requestLookup.getContextPath(), "/test2"); }