use of eu.europeana.metis.network.StringHttpClient.StringContent in project metis-framework by europeana.
the class StringHttpClientTest method createResult.
@Test
void createResult() throws URISyntaxException, IOException {
List<Closeable> closeables = new ArrayList<>();
HttpEntity responseEntity = new BasicHttpEntity(new ByteArrayInputStream("content".getBytes()), ContentType.TEXT_PLAIN);
final ContentRetriever contentRetriever = ContentRetriever.forNonCloseableContent(responseEntity == null ? InputStream::nullInputStream : responseEntity::getContent, closeables::add);
StringContent actualContent = stringHttpClient.createResult(new URI("/resource/provided"), new URI("/resource/actual"), "text/plain", 7L, contentRetriever);
assertEquals("content", actualContent.getContent());
assertEquals("text/plain", actualContent.getContentType());
}
use of eu.europeana.metis.network.StringHttpClient.StringContent in project metis-framework by europeana.
the class StringHttpClientTest method stringContent.
@Test
void stringContent() {
StringContent stringContent = new StringContent("content", "text/plain");
assertEquals("content", stringContent.getContent());
assertEquals("text/plain", stringContent.getContentType());
}
Aggregations