use of org.springframework.http.converter.json.MappingJackson2HttpMessageConverter in project spring-boot-admin by codecentric.
the class AdminServerWebConfigurationTest method jacksonMapperPresentFromDefault.
@Test
public void jacksonMapperPresentFromDefault() {
AdminServerWebConfiguration config = new AdminServerWebConfiguration(null, null, null, null);
List<HttpMessageConverter<?>> converters = new ArrayList<>();
converters.add(new MappingJackson2HttpMessageConverter());
config.extendMessageConverters(converters);
assertThat(converters, hasItem(isA(MappingJackson2HttpMessageConverter.class)));
assertThat(converters.size(), is(1));
}
use of org.springframework.http.converter.json.MappingJackson2HttpMessageConverter in project mirrorgate-jira-stories-collector by BBVA.
the class Config method getRestTemplate.
@Bean(MIRRORGATE_REST_TEMPLATE)
public RestTemplate getRestTemplate() {
RestTemplate restTemplate = new RestTemplate();
MappingJackson2HttpMessageConverter jsonHttpMessageConverter = new MappingJackson2HttpMessageConverter();
restTemplate.getMessageConverters().add(jsonHttpMessageConverter);
if (mirrorGateUserName.isPresent() && !mirrorGateUserName.get().isEmpty()) {
restTemplate.getInterceptors().add(new BasicAuthorizationInterceptor(mirrorGateUserName.get(), mirrorGatePassword.get()));
}
return restTemplate;
}
use of org.springframework.http.converter.json.MappingJackson2HttpMessageConverter in project Activiti by Activiti.
the class DispatcherServletConfiguration method configureMessageConverters.
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
addDefaultHttpMessageConverters(converters);
for (HttpMessageConverter<?> converter : converters) {
if (converter instanceof MappingJackson2HttpMessageConverter) {
MappingJackson2HttpMessageConverter jackson2HttpMessageConverter = (MappingJackson2HttpMessageConverter) converter;
jackson2HttpMessageConverter.setObjectMapper(objectMapper);
break;
}
}
}
use of org.springframework.http.converter.json.MappingJackson2HttpMessageConverter in project Activiti by Activiti.
the class DispatcherServletConfiguration method configureMessageConverters.
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
addDefaultHttpMessageConverters(converters);
for (HttpMessageConverter<?> converter : converters) {
if (converter instanceof MappingJackson2HttpMessageConverter) {
MappingJackson2HttpMessageConverter jackson2HttpMessageConverter = (MappingJackson2HttpMessageConverter) converter;
jackson2HttpMessageConverter.setObjectMapper(objectMapper);
break;
}
}
}
use of org.springframework.http.converter.json.MappingJackson2HttpMessageConverter in project cas by apereo.
the class RegisteredServiceResourceTests method configureMockMvcFor.
private MockMvc configureMockMvcFor(final RegisteredServiceResource registeredServiceResource) {
final DefaultRegisteredServiceJsonSerializer sz = new DefaultRegisteredServiceJsonSerializer();
final MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(sz.getObjectMapper());
return MockMvcBuilders.standaloneSetup(registeredServiceResource).defaultRequest(get("/").contextPath("/cas").contentType(MediaType.APPLICATION_JSON)).setMessageConverters(converter).build();
}
Aggregations