use of org.apache.servicecomb.demo.compute.Person in project java-chassis by ServiceComb.
the class JaxrsIntegrationTestBase method ableToPostWithHeader.
@Test
public void ableToPostWithHeader() {
Person person = new Person();
person.setName("person name");
HttpHeaders headers = new HttpHeaders();
headers.setContentType(APPLICATION_JSON);
headers.add("prefix", "prefix prefix");
HttpEntity<Person> requestEntity = new HttpEntity<>(person, headers);
for (String url : urls) {
ResponseEntity<String> responseEntity = restTemplate.postForEntity(url + "saysomething", requestEntity, String.class);
assertEquals("prefix prefix person name", jsonBodyOf(responseEntity, String.class));
}
}
Aggregations