JacksonMapperDateConfig.java

1
package org.cardanofoundation.explorer.api.config;
2
3
import java.time.format.DateTimeFormatter;
4
5
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
6
import org.springframework.context.annotation.Bean;
7
import org.springframework.context.annotation.Configuration;
8
9
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
10
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
11
12
@Configuration
13
public class JacksonMapperDateConfig {
14
15
  private static final String DATE_FORMAT = "yyyy/MM/dd";
16
  public static final String DATE_TIME_FORMAT = "yyyy/MM/dd HH:mm:ss";
17
18
  @Bean
19
  public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
20 1 1. jsonCustomizer : replaced return value with null for org/cardanofoundation/explorer/api/config/JacksonMapperDateConfig::jsonCustomizer → SURVIVED
    return builder -> {
21
      builder.simpleDateFormat(DATE_TIME_FORMAT);
22
      builder.serializers(new LocalDateSerializer(DateTimeFormatter.ofPattern(DATE_FORMAT)));
23
      builder.serializers(
24
          new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DATE_TIME_FORMAT)));
25
    };
26
  }
27
}

Mutations

20

1.1
Location : jsonCustomizer
Killed by : none
replaced return value with null for org/cardanofoundation/explorer/api/config/JacksonMapperDateConfig::jsonCustomizer → SURVIVED

Active mutators

Tests examined


Report generated by PIT 1.14.2