AbstractAction implements Action<T> { @Override public String getURI(ElasticsearchVersion elasticsearchVersion) { String finalUri = buildURI(elasticsearchVersion); if (!parameterMap.isEmpty() || !cleanApiParameters.isEmpty()) { try { finalUri += buildQueryString(); } catch (UnsupportedEncodingException e) { log.error("Error occurred while adding parameters to uri.", e); } } return finalUri; } AbstractAction(); @SuppressWarnings("unchecked")  AbstractAction(Builder builder); static String getIdFromSource(Object source); Collection<Object> getParameter(String parameter); Object getHeader(String header); @Override Map<String, Object> getHeaders(); @Override String getURI(ElasticsearchVersion elasticsearchVersion); @Override String getData(Gson gson); @Override String getPathToResult(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); abstract String getRestMethodName(); static String CHARSET; }
@Test public void buildUrlWithRequestParameterWithMultipleValues() { DummyAction dummyAction = new DummyAction.Builder() .setParameter("x", "y") .setParameter("x", "z") .setParameter("x", "q") .setParameter("w", "p") .build(); assertEquals("?x=y&x=z&x=q&w=p", dummyAction.getURI(ElasticsearchVersion.UNKNOWN)); }