From 52abb281ff20fce81445eb9d71fb6fb022f14d2d Mon Sep 17 00:00:00 2001 From: Filip Izydorczyk Date: Thu, 10 Dec 2020 15:17:13 +0100 Subject: [PATCH] commision date fix --- .../plannaplan/responses/models/CommisionResponse.java | 8 +++----- .../responses/mappers/CommisionResponseMappersTest.java | 4 ++-- .../responses/models/CommisionResponseTest.java | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/restservice/src/main/java/com/plannaplan/responses/models/CommisionResponse.java b/restservice/src/main/java/com/plannaplan/responses/models/CommisionResponse.java index 63df94d..e995e27 100755 --- a/restservice/src/main/java/com/plannaplan/responses/models/CommisionResponse.java +++ b/restservice/src/main/java/com/plannaplan/responses/models/CommisionResponse.java @@ -1,7 +1,5 @@ package com.plannaplan.responses.models; -import java.sql.Timestamp; - import com.plannaplan.entities.Commision; import io.swagger.annotations.ApiModel; @@ -13,14 +11,14 @@ public class CommisionResponse { private Long id; @ApiModelProperty(value = "Timestamp where the user commit the commision") - private Timestamp commisionDate; + private String commisionDate; public CommisionResponse(Commision commision) { this.id = commision.getId(); - this.commisionDate = commision.getCommisionDate(); + this.commisionDate = commision.getCommisionDate().toString(); } - public Timestamp getCommisionDate() { + public String getCommisionDate() { return commisionDate; } diff --git a/restservice/src/test/java/com/plannaplan/responses/mappers/CommisionResponseMappersTest.java b/restservice/src/test/java/com/plannaplan/responses/mappers/CommisionResponseMappersTest.java index 95d02a6..e378617 100755 --- a/restservice/src/test/java/com/plannaplan/responses/mappers/CommisionResponseMappersTest.java +++ b/restservice/src/test/java/com/plannaplan/responses/mappers/CommisionResponseMappersTest.java @@ -17,7 +17,7 @@ public class CommisionResponseMappersTest { final List resposne = CommisionResponseMappers.mapToResponse(coms); assertTrue(resposne.get(0) instanceof CommisionResponse); - assertTrue(resposne.get(0).getCommisionDate().equals(coms.get(0).getCommisionDate())); - assertTrue(resposne.get(1).getCommisionDate().equals(coms.get(1).getCommisionDate())); + assertTrue(resposne.get(0).getCommisionDate().equals(coms.get(0).getCommisionDate().toString())); + assertTrue(resposne.get(1).getCommisionDate().equals(coms.get(1).getCommisionDate().toString())); } } diff --git a/restservice/src/test/java/com/plannaplan/responses/models/CommisionResponseTest.java b/restservice/src/test/java/com/plannaplan/responses/models/CommisionResponseTest.java index 23edc29..6a151ae 100755 --- a/restservice/src/test/java/com/plannaplan/responses/models/CommisionResponseTest.java +++ b/restservice/src/test/java/com/plannaplan/responses/models/CommisionResponseTest.java @@ -12,6 +12,6 @@ public class CommisionResponseTest { final Commision com = new Commision(null); final CommisionResponse comResponse = new CommisionResponse(com); - assertTrue(comResponse.getCommisionDate().equals(com.getCommisionDate())); + assertTrue(comResponse.getCommisionDate().equals(com.getCommisionDate().toString())); } }