use of org.springframework.http.converter.ByteArrayHttpMessageConverter in project dhis2-core by dhis2.
the class WebMvcConfig method configureMessageConverters.
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
Arrays.stream(Compression.values()).forEach(compression -> converters.add(new JsonMessageConverter(nodeService(), compression)));
Arrays.stream(Compression.values()).forEach(compression -> converters.add(new XmlMessageConverter(nodeService(), compression)));
converters.add(new StringHttpMessageConverter(StandardCharsets.UTF_8));
converters.add(new ByteArrayHttpMessageConverter());
converters.add(new FormHttpMessageConverter());
converters.add(mappingJackson2HttpMessageConverter());
converters.add(mappingJackson2XmlHttpMessageConverter());
}
use of org.springframework.http.converter.ByteArrayHttpMessageConverter in project vorto by eclipse.
the class RepositoryConfiguration method restTemplate.
@Bean
public RestTemplate restTemplate() {
RestTemplate restTemplate = new RestTemplate(new BufferingClientHttpRequestFactory(new SimpleClientHttpRequestFactory()));
List<ClientHttpRequestInterceptor> interceptors = new ArrayList<>();
interceptors.add(new LoggingInterceptor());
restTemplate.setInterceptors(interceptors);
restTemplate.getMessageConverters().add(new ByteArrayHttpMessageConverter());
return restTemplate;
}
use of org.springframework.http.converter.ByteArrayHttpMessageConverter in project incubator-servicecomb-java-chassis by apache.
the class TestRestTemplateWrapper method setMessageConvertersWithUnderlying.
@SuppressWarnings("unchecked")
@Test
public void setMessageConvertersWithUnderlying() {
ByteArrayHttpMessageConverter messageConverter = mock(ByteArrayHttpMessageConverter.class);
wrapper.setMessageConverters(singletonList(messageConverter));
assertThat(wrapper.getMessageConverters(), contains(messageConverter));
assertThat(wrapper.defaultRestTemplate.getMessageConverters(), contains(messageConverter));
verify(underlying, never()).setMessageConverters(singletonList(messageConverter));
}
Aggregations