use of org.springframework.http.MockHttpInputMessage in project spring-framework by spring-projects.
the class ByteArrayHttpMessageConverterTests method read.
@Test
public void read() throws IOException {
byte[] body = new byte[] { 0x1, 0x2 };
MockHttpInputMessage inputMessage = new MockHttpInputMessage(body);
inputMessage.getHeaders().setContentType(new MediaType("application", "octet-stream"));
byte[] result = converter.read(byte[].class, inputMessage);
assertThat(result).as("Invalid result").isEqualTo(body);
}
Aggregations