Fixing tests

This commit is contained in:
Arjen Poutsma 2009-02-22 10:15:32 +00:00
parent 1bc5188953
commit 0db40dd676
1 changed files with 2 additions and 2 deletions

View File

@ -55,12 +55,12 @@ public class StringHttpMessageConverterTests {
Charset charset = Charset.forName("UTF-8");
converter.setSupportedMediaTypes(Collections.singletonList(new MediaType("text", "plain", charset)));
MockHttpOutputMessage outputMessage = new MockHttpOutputMessage();
String body = "HŽllo W¿rld";
String body = "Hello World";
converter.write(body, outputMessage);
assertEquals("Invalid result", body, outputMessage.getBodyAsString(charset));
assertEquals("Invalid content-type", new MediaType("text", "plain", charset),
outputMessage.getHeaders().getContentType());
assertEquals("Invalid content-length", 13, outputMessage.getHeaders().getContentLength());
assertEquals("Invalid content-length", 11, outputMessage.getHeaders().getContentLength());
assertFalse("Invalid accept-charset", outputMessage.getHeaders().getAcceptCharset().isEmpty());
}
}