@Test public void shouldReturnParsedPairsOutOfUrlEncodedEntity() throws IOException { InputStream stream = new ByteArrayInputStream(URL_ENCODED_FORM.getBytes()); List<EncodedPair> actual = toTest.extract(null, UTF8, stream); assertEquals(3, actual.size()); assertEquals("p1", actual.get(0).getName()); assertEquals("v%201", actual.get(0).getValue()); assertEquals("p1", actual.get(1).getName()); assertEquals("v%202", actual.get(1).getValue()); assertEquals("p3", actual.get(2).getName()); assertEquals("v3", actual.get(2).getValue()); }
public List<EncodedPair> extract(String contentType, Charset charset, InputStream entity) throws IOException { String formContent = IOs.toString(entity, charset); if(isNotBlank(formContent)) { return fromUrlEncoded(formContent); }else{ return emptyList(); } }
UrlEncodedFormEntityParamExtractor implements EntityParamExtractor { public List<EncodedPair> extract(String contentType, Charset charset, InputStream entity) throws IOException { String formContent = IOs.toString(entity, charset); if(isNotBlank(formContent)) { return fromUrlEncoded(formContent); }else{ return emptyList(); } } }
UrlEncodedFormEntityParamExtractor implements EntityParamExtractor { public List<EncodedPair> extract(String contentType, Charset charset, InputStream entity) throws IOException { String formContent = IOs.toString(entity, charset); if(isNotBlank(formContent)) { return fromUrlEncoded(formContent); }else{ return emptyList(); } }  }
UrlEncodedFormEntityParamExtractor implements EntityParamExtractor { public List<EncodedPair> extract(String contentType, Charset charset, InputStream entity) throws IOException { String formContent = IOs.toString(entity, charset); if(isNotBlank(formContent)) { return fromUrlEncoded(formContent); }else{ return emptyList(); } }  List<EncodedPair> extract(String contentType, Charset charset, InputStream entity); }
UrlEncodedFormEntityParamExtractor implements EntityParamExtractor { public List<EncodedPair> extract(String contentType, Charset charset, InputStream entity) throws IOException { String formContent = IOs.toString(entity, charset); if(isNotBlank(formContent)) { return fromUrlEncoded(formContent); }else{ return emptyList(); } }  List<EncodedPair> extract(String contentType, Charset charset, InputStream entity);  }