Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;
import static org.hamcrest.MatcherAssert.assertThat;

public class TestHttpServerTest
{
Expand Down Expand Up @@ -94,7 +95,7 @@ private String getHttpContent(String url) throws IOException
try(CloseableHttpResponse response = client.execute( request ))
{
InputStream stream = response.getEntity().getContent();
return IOUtils.toString( stream );
return IOUtils.toString( stream, StandardCharsets.UTF_8 );
}
finally
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.junit.jupiter.api.Test;

import java.io.InputStream;
import java.nio.charset.StandardCharsets;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
Expand Down Expand Up @@ -91,7 +92,7 @@ public void simpleDownload()
{
response = client.execute( request );
stream = response.getEntity().getContent();
final String result = IOUtils.toString( stream );
final String result = IOUtils.toString( stream, StandardCharsets.UTF_8 );

assertThat( result, notNullValue() );
assertThat( result, equalTo( content ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.junit.jupiter.api.Test;

import java.io.InputStream;
import java.nio.charset.StandardCharsets;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
Expand Down Expand Up @@ -94,7 +95,7 @@ public void simpleDownload()
{
response = client.execute( request );
stream = response.getEntity().getContent();
final String result = IOUtils.toString( stream );
final String result = IOUtils.toString( stream, StandardCharsets.UTF_8 );

assertThat( result, notNullValue() );
assertThat( result, equalTo( content ) );
Expand Down