Skip to content

Commit

Permalink
* removed JSONFormat from DTO since it made problems with the downloa…
Browse files Browse the repository at this point in the history
…d function

* added format just for the necessary testing
  • Loading branch information
Morphyum committed Mar 15, 2022
1 parent 2a0999f commit 32e031c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -72,6 +73,7 @@ class RevocationListUploadConnectorTest {
@Autowired
DgcTestKeyStore testKeyStore;

ObjectMapper mapper = new ObjectMapper();

@Test
void testUploadOfRevocationList() throws Exception {
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 32e031c

Please sign in to comment.