use of org.springframework.http.HttpOutputMessage in project geode by apache.
the class SerializableObjectHttpMessageConverterJUnitTest method testSetContentLength.
@Test
public void testSetContentLength() {
final byte[] bytes = { (byte) 0xCA, (byte) 0xFE, (byte) 0xBA, (byte) 0xBE };
final HttpHeaders headers = new HttpHeaders();
final HttpOutputMessage mockOutputMessage = mockContext.mock(HttpOutputMessage.class, "HttpOutputMessage");
mockContext.checking(new Expectations() {
{
oneOf(mockOutputMessage).getHeaders();
will(returnValue(headers));
}
});
final SerializableObjectHttpMessageConverter converter = new SerializableObjectHttpMessageConverter();
converter.setContentLength(mockOutputMessage, bytes);
assertEquals(bytes.length, headers.getContentLength());
}
Aggregations