I'm using infinitest in Eclipse and I have a strange phenomenon in connection with JUnit.
I have code that uses org.apache.http.HttpResponse.getEntity()
and org.apache.http.entity.StringEntity
. The JUnit test looks like this:
@Test
public void convertEncodedContentToString() throws UnsupportedEncodingException {
HttpResponse httpResponseMock = Mockito.mock(HttpResponse.class);
Mockito.when(httpResponseMock.getEntity()).thenReturn(new StringEntity("huiäöüß@€", HTTP.UTF_8));
Assert.assertEquals("huiäöüß@€", parser.convertContentToString(httpResponseMock));
}
All source files are stored in UTF-8.
If I let JUnit execute this method, it works fine.
However, if infinitest runs this test it complains that the assertion fails.
ComparisonFailure (expected:<hui[äöüß@€]> but was:<hui[äöüß@€]>) in ResponseBodyParserFactoryTest.convertEncodedContentToString
Obviously there is a character encoding problem.
As infinitest has close to no options I have no idea how to help infinitest to run this test properly. Can anyone please help me out here?