use of org.apache.servicecomb.provider.springmvc.reference.CseHttpEntity in project java-chassis by ServiceComb.
the class TestContentType method testGlobalSetting.
private void testGlobalSetting() {
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.add(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_PLAIN);
CseHttpEntity<String> requestEntity = new CseHttpEntity<>("from testGlobalSetting", requestHeaders);
ResponseEntity<String> responseEntity = restTemplate.exchange("cse://springmvc/contentTypeSpringmvc/testGlobalSetting", HttpMethod.POST, requestEntity, String.class);
TestMgr.check("testGlobalSetting: name=[from testGlobalSetting], request content-type=[" + MediaType.TEXT_PLAIN + "]", responseEntity.getBody());
TestMgr.check(MediaType.TEXT_PLAIN, extractContentType(responseEntity.getHeaders().getContentType()));
}
use of org.apache.servicecomb.provider.springmvc.reference.CseHttpEntity in project java-chassis by ServiceComb.
the class BeanParamRestTemplateClient method testBeanParam.
private void testBeanParam() {
HttpHeaders headers = new HttpHeaders();
headers.add("Cookie", "cookieSwaggerLong=11");
headers.add("headerSwaggerInt", "2");
HttpEntity<Object> requestEntity1 = new CseHttpEntity<>(headers);
ResponseEntity<String> result = restTemplate.exchange("cse://jaxrs/beanParamTest/pathSwaggerValue/simple?querySwaggerStr=querySwaggerValue&extraQuery=extra", HttpMethod.GET, requestEntity1, String.class);
TestMgr.check("invocationContextConsistency=true|testBeanParameter=TestBeanParameter{queryStr='querySwaggerValue', headerInt=2, " + "pathStr='pathSwaggerValue', cookieLong=11}|extraQuery=extra", result.getBody());
}
Aggregations