use of org.apache.servicecomb.demo.jaxbbean.JAXBJob in project java-chassis by ServiceComb.
the class CodeFirstRestTemplate method testCodeFirstAppXml.
private void testCodeFirstAppXml(RestTemplate template, String cseUrlPrefix) {
JAXBPerson person = new JAXBPerson("jake", 22, "it", "60kg");
person.setJob(new JAXBJob("developer", "coding"));
HttpHeaders headers = new HttpHeaders();
headers.add("Accept", MediaType.APPLICATION_XML_VALUE);
headers.add("Content-Type", MediaType.APPLICATION_JSON_VALUE);
HttpEntity<JAXBPerson> requestEntity = new HttpEntity<>(person, headers);
ResponseEntity<JAXBPerson> resEntity = template.exchange(cseUrlPrefix + "appXml", HttpMethod.POST, requestEntity, JAXBPerson.class);
TestMgr.check(-1, ProduceProcessorManager.INSTANCE.findProcessor(MediaType.APPLICATION_XML_VALUE, null).getOrder());
// test case maybe fail in JDK 11
TestMgr.check(person, resEntity.getBody());
}
Aggregations