commision date fix

This commit is contained in:
Filip Izydorczyk 2020-12-10 15:17:13 +01:00
parent acf80cc78d
commit 52abb281ff
3 changed files with 6 additions and 8 deletions

View File

@ -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;
}

View File

@ -17,7 +17,7 @@ public class CommisionResponseMappersTest {
final List<CommisionResponse> 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()));
}
}

View File

@ -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()));
}
}