@Test public void build_formParams_requestContainsOnlyFormParams() throws ActionException { ExposedRestAction<Void> action = new SecuredRestAction(GET, RELATIVE_PATH); action.addParam(new FormParameter("Key1", "Some Value", null, urlUtils)); factory.buildBody(requestBuilder, action); verify(requestBuilder).setRequestData(eq(QUERY_STRING)); verify(requestBuilder).setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED); }
@Override public void buildBody(RequestBuilder requestBuilder, RestAction<?> action) throws ActionException { if (action.hasFormParams()) { assignBodyFromForm(requestBuilder, action); } else { assignBodyFromSerialization(requestBuilder, action); } }
DefaultBodyFactory implements BodyFactory { @Override public void buildBody(RequestBuilder requestBuilder, RestAction<?> action) throws ActionException { if (action.hasFormParams()) { assignBodyFromForm(requestBuilder, action); } else { assignBodyFromSerialization(requestBuilder, action); } } }
DefaultBodyFactory implements BodyFactory { @Override public void buildBody(RequestBuilder requestBuilder, RestAction<?> action) throws ActionException { if (action.hasFormParams()) { assignBodyFromForm(requestBuilder, action); } else { assignBodyFromSerialization(requestBuilder, action); } } @Inject  DefaultBodyFactory(
            Provider<Set<Serialization>> serializationsProvider,
            UriFactory uriFactory); }
DefaultBodyFactory implements BodyFactory { @Override public void buildBody(RequestBuilder requestBuilder, RestAction<?> action) throws ActionException { if (action.hasFormParams()) { assignBodyFromForm(requestBuilder, action); } else { assignBodyFromSerialization(requestBuilder, action); } } @Inject  DefaultBodyFactory(
            Provider<Set<Serialization>> serializationsProvider,
            UriFactory uriFactory); @Override void buildBody(RequestBuilder requestBuilder, RestAction<?> action); }
DefaultBodyFactory implements BodyFactory { @Override public void buildBody(RequestBuilder requestBuilder, RestAction<?> action) throws ActionException { if (action.hasFormParams()) { assignBodyFromForm(requestBuilder, action); } else { assignBodyFromSerialization(requestBuilder, action); } } @Inject  DefaultBodyFactory(
            Provider<Set<Serialization>> serializationsProvider,
            UriFactory uriFactory); @Override void buildBody(RequestBuilder requestBuilder, RestAction<?> action);  }