@Test public void force_secure_URI_from_insecure_link() { Response response = mockResponse(); BaseURLSource baseURLSource = mockBaseURLSource(); train_getBaseURL(baseURLSource, true, SECURE_BASE_URL); train_encodeURL(response, SECURE_BASE_URL + BASE_PATH, ENCODED); replay(); Link link = new LinkImpl(BASE_PATH, false, LinkSecurity.INSECURE, response, null, baseURLSource); assertEquals(link.toAbsoluteURI(true), ENCODED); verify(); }
public String toAbsoluteURI() { return buildAnchoredURI(defaultSecurity.promote()); }
LinkImpl implements Link { public String toAbsoluteURI() { return buildAnchoredURI(defaultSecurity.promote()); } }
LinkImpl implements Link { public String toAbsoluteURI() { return buildAnchoredURI(defaultSecurity.promote()); } LinkImpl(String basePath, boolean forForm, LinkSecurity defaultSecurity, Response response,
                    ContextPathEncoder contextPathEncoder, BaseURLSource baseURLSource); }
LinkImpl implements Link { public String toAbsoluteURI() { return buildAnchoredURI(defaultSecurity.promote()); } 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); }
LinkImpl implements Link { public String toAbsoluteURI() { return buildAnchoredURI(defaultSecurity.promote()); } 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);  }