/** * Encodes the given {@link RestParameter} as a query parameter. The default implementation * delegates to {@link UrlUtils#encodeQueryString(String)}. * * @param value the value to encode. * @return the encoded query parameter. * @throws ActionException if an exception occurred while encoding the query parameter. * @see #encode(com.gwtplatform.dispatch.rest.shared.RestParameter) */ protected String encodeQueryParam(String value) throws ActionException { return urlUtils.encodeQueryString(value); }
@Before public void setUp() { given(urlUtils.encodeQueryString(KEY)).willReturn(ENCODED_KEY); given(urlUtils.encodeQueryString(VALUE_1)).willReturn(ENCODED_VALUE_1); given(urlUtils.encodeQueryString(VALUE_2)).willReturn(ENCODED_VALUE_2); }
/** * Encodes the given {@link RestParameter} as a path parameter. The default implementation * delegates to {@link UrlUtils#encodePathSegment(String)}. * * @param value the value to encode. * @return the encoded path parameter. * @throws ActionException if an exception occurred while encoding the path parameter. * @see #encode(com.gwtplatform.dispatch.rest.shared.RestParameter) */ protected String encodePathParam(String value) throws ActionException { return urlUtils.encodePathSegment(value); }