LinkImpl implements Link { public String toRedirectURI() { return appendAnchor(response.encodeRedirectURL(buildURI(defaultSecurity))); } LinkImpl(String basePath, boolean forForm, LinkSecurity defaultSecurity, Response response,
                    ContextPathEncoder contextPathEncoder, BaseURLSource baseURLSource); Link copyWithBasePath(String basePath); Link addParameter(String parameterName, String value); String getBasePath(); Link removeParameter(String parameterName); String getAnchor(); List<String> getParameterNames(); String getParameterValue(String name); Link setAnchor(String anchor); String toAbsoluteURI(); String toAbsoluteURI(boolean secure); void setSecurity(LinkSecurity newSecurity); LinkSecurity getSecurity(); String toRedirectURI(); String toURI(); @Override String toString(); Link addParameterValue(String parameterName, Object value); String[] getParameterValues(String parameterName);  }
@Test public void simple_redirect() { Response response = mockResponse(); String URI = "/base/context/" + RAW_PATH; train_encodeRedirectURL(response, URI, ENCODED); replay(); Link link = new LinkImpl(URI, false, LinkSecurity.INSECURE, response, null, null); assertEquals(link.toRedirectURI(), ENCODED); verify(); }