//package vn.azteam.tpf.config;
//
//import com.fasterxml.jackson.databind.ObjectMapper;
//import com.fasterxml.jackson.databind.SerializationFeature;
//import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
//import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
//import org.springframework.web.client.RestTemplate;
//
//@Configuration
//public class RestConfiguration {
//
//    @Bean
//    public RestTemplate myRestTemplate(HttpMessageConverters customConverters) {
//        RestTemplate restTemplate = new RestTemplate();
//        restTemplate.setMessageConverters(customConverters.getConverters());
//        return restTemplate;
//    }
//
//    /*
//     * The following custom HttpMessageConverter is injected into myRestTemplate
//     * in order to appropriately configure the serialization/deserialization of LocalDate
//     * instances into/from strings.
//     */
//    @Bean
//    public HttpMessageConverters customConverters() {
//        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
//
//        ObjectMapper mapper = new ObjectMapper();
//        mapper.registerModule(new JavaTimeModule());
//        mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
//        mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
//        converter.setObjectMapper(mapper);
//        return new HttpMessageConverters(converter);
//    }
//
//}
