use of org.springframework.http.converter.HttpMessageConverter in project robospice by stephanenicolas.
the class GsonSpringAndroidSpiceService method createRestTemplate.
@Override
public RestTemplate createRestTemplate() {
RestTemplate restTemplate = new RestTemplate();
// web services support json responses
GsonHttpMessageConverter jsonConverter = new GsonHttpMessageConverter();
final List<HttpMessageConverter<?>> listHttpMessageConverters = restTemplate.getMessageConverters();
listHttpMessageConverters.add(jsonConverter);
restTemplate.setMessageConverters(listHttpMessageConverters);
return restTemplate;
}
use of org.springframework.http.converter.HttpMessageConverter in project robospice by stephanenicolas.
the class Jackson2SpringAndroidSpiceService method createRestTemplate.
@Override
public RestTemplate createRestTemplate() {
RestTemplate restTemplate = new RestTemplate();
// web services support json responses
MappingJackson2HttpMessageConverter jsonConverter = new MappingJackson2HttpMessageConverter();
final List<HttpMessageConverter<?>> listHttpMessageConverters = restTemplate.getMessageConverters();
listHttpMessageConverters.add(jsonConverter);
restTemplate.setMessageConverters(listHttpMessageConverters);
return restTemplate;
}
use of org.springframework.http.converter.HttpMessageConverter in project spring-framework by spring-projects.
the class ContentRequestMatchersIntegrationTests method setup.
@Before
public void setup() {
List<HttpMessageConverter<?>> converters = new ArrayList<>();
converters.add(new StringHttpMessageConverter());
converters.add(new MappingJackson2HttpMessageConverter());
this.restTemplate = new RestTemplate();
this.restTemplate.setMessageConverters(converters);
this.mockServer = MockRestServiceServer.createServer(this.restTemplate);
}
use of org.springframework.http.converter.HttpMessageConverter in project spring-framework by spring-projects.
the class HeaderRequestMatchersIntegrationTests method setup.
@Before
public void setup() {
List<HttpMessageConverter<?>> converters = new ArrayList<>();
converters.add(new StringHttpMessageConverter());
converters.add(new MappingJackson2HttpMessageConverter());
this.restTemplate = new RestTemplate();
this.restTemplate.setMessageConverters(converters);
this.mockServer = MockRestServiceServer.createServer(this.restTemplate);
}
use of org.springframework.http.converter.HttpMessageConverter in project spring-framework by spring-projects.
the class XmlContentRequestMatchersIntegrationTests method setup.
@Before
public void setup() {
List<Person> composers = Arrays.asList(new Person("Johann Sebastian Bach").setSomeDouble(21), new Person("Johannes Brahms").setSomeDouble(.0025), new Person("Edvard Grieg").setSomeDouble(1.6035), new Person("Robert Schumann").setSomeDouble(Double.NaN));
this.people = new PeopleWrapper(composers);
List<HttpMessageConverter<?>> converters = new ArrayList<>();
converters.add(new Jaxb2RootElementHttpMessageConverter());
this.restTemplate = new RestTemplate();
this.restTemplate.setMessageConverters(converters);
this.mockServer = MockRestServiceServer.createServer(this.restTemplate);
}
Aggregations