use of org.springframework.http.MockHttpInputMessage in project spring-framework by spring-projects.
the class Jaxb2RootElementHttpMessageConverterTests method readXmlRootElement.
@Test
public void readXmlRootElement() throws Exception {
byte[] body = "<rootElement><type s=\"Hello World\"/></rootElement>".getBytes("UTF-8");
MockHttpInputMessage inputMessage = new MockHttpInputMessage(body);
RootElement result = (RootElement) converter.read(RootElement.class, inputMessage);
assertEquals("Invalid result", "Hello World", result.type.s);
}
Aggregations