#55 fixed mockMvcTests

This commit is contained in:
Fabio Formosa
2021-12-07 23:56:50 +01:00
parent cbd3066f57
commit 3ba2bafc55

View File

@@ -1,11 +1,17 @@
package it.fabioformosa.quartzmanager.controllers.utils;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.util.StdDateFormat;
import lombok.SneakyThrows;
public class TestUtils {
static public ObjectMapper objectMapper = new ObjectMapper();
static public ObjectMapper objectMapper = new ObjectMapper();
static{
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
objectMapper.setDateFormat(new StdDateFormat().withColonInTimeZone(true)); // StdDateFormat is ISO8601 since jackson 2.9
}
@SneakyThrows
static public String toJson(Object object){