package org.talend.dataprep.configuration;

import java.util.List;

import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JSR310Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.Module;

@Configuration
@SuppressWarnings("InsufficientBranchCoverage")
public class Serialization {

    @Autowired
    List<Module> modules;

    @Bean
    public Jackson2ObjectMapperBuilder jacksonBuilder() {
        Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder();
        builder.featuresToDisable(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES);
        builder.indentOutput(false);
        modules.add( new JavaTimeModule() );
        modules.add( new Jdk8Module() );
        builder.modules(modules);
        return builder;
    }
}

@@ -1005,32 +1005,122 @@
 false);%0A        
+// FIXME we should use jackson modules and remove home made LocalDateTimeModule%0A        //
 modules.add( new
@@ -1148,16 +1148,18 @@
         
+//
 modules.

comment use of new jackson module for LocalDateTime and add FIXME