Skip to content

Commit

Permalink
Instant time POC
Browse files Browse the repository at this point in the history
  • Loading branch information
grabsefx committed Nov 27, 2024
1 parent 40449d6 commit ec4063e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies {
api 'com.fasterxml.jackson.core:jackson-databind:2.12.7.1' // Access is needed by HTTP loggers to format JSON
api 'io.reactivex.rxjava2:rxjava:2.2.10'
api 'com.google.code.findbugs:jsr305:3.0.2'
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.0'

api ("com.squareup.retrofit2:retrofit:${project.retrofit_version}") {
exclude module: 'okhttp'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.epam.reportportal.utils.files.ByteSource;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import org.slf4j.Logger;
Expand All @@ -43,13 +48,15 @@
public class HttpRequestUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(HttpRequestUtils.class);
public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
public static final ObjectMapper MAPPER;

static {
MAPPER = new ObjectMapper();
MAPPER.setDateFormat(new SimpleDateFormat(DEFAULT_DATE_FORMAT));
MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
public static final ObjectMapper MAPPER = JsonMapper.builder()
.addModule(new JavaTimeModule())
.annotationIntrospector(new JacksonAnnotationIntrospector())
.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, true)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
.configure(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS, false)
.addModule(new JavaTimeModule())
.build();

private static final String DEFAULT_TYPE = "application/octet-stream";

Expand Down

0 comments on commit ec4063e

Please sign in to comment.