diff --git a/src/main/java/eu/europa/ec/dgc/gateway/connector/dto/RevocationBatchDto.java b/src/main/java/eu/europa/ec/dgc/gateway/connector/dto/RevocationBatchDto.java index bd6eb0e..f518fcf 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/connector/dto/RevocationBatchDto.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/connector/dto/RevocationBatchDto.java @@ -35,7 +35,6 @@ public class RevocationBatchDto { private String country; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") private ZonedDateTime expires; private String kid; diff --git a/src/test/java/eu/europa/ec/dgc/gateway/connector/RevocationListUploadConnectorTest.java b/src/test/java/eu/europa/ec/dgc/gateway/connector/RevocationListUploadConnectorTest.java index 318d8c5..f8c3371 100644 --- a/src/test/java/eu/europa/ec/dgc/gateway/connector/RevocationListUploadConnectorTest.java +++ b/src/test/java/eu/europa/ec/dgc/gateway/connector/RevocationListUploadConnectorTest.java @@ -27,6 +27,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.util.StdDateFormat; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import eu.europa.ec.dgc.gateway.connector.client.DgcGatewayConnectorRestClient; import eu.europa.ec.dgc.gateway.connector.dto.RevocationBatchDeleteRequestDto; @@ -72,6 +73,7 @@ class RevocationListUploadConnectorTest { @Autowired DgcTestKeyStore testKeyStore; + ObjectMapper mapper = new ObjectMapper(); @Test void testUploadOfRevocationList() throws Exception { @@ -344,15 +346,15 @@ private RevocationBatchDto getRevocation() { } private String getRevocationJSON() throws JsonProcessingException { - ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(new JavaTimeModule()); + mapper.setDateFormat(new StdDateFormat().withColonInTimeZone(true)); return mapper.writeValueAsString(getRevocation()); } private String getDeleteJSON(String batchId) throws JsonProcessingException { RevocationBatchDeleteRequestDto deleteRequest = new RevocationBatchDeleteRequestDto(); deleteRequest.setBatchId(batchId); - ObjectMapper mapper = new ObjectMapper(); + mapper.registerModule(new JavaTimeModule()); return mapper.writeValueAsString(deleteRequest); }