From a79a765facba1e633c97eb5766c14691e5c1a4f5 Mon Sep 17 00:00:00 2001 From: norangebit Date: Wed, 13 Nov 2019 14:48:58 +0100 Subject: [PATCH] fix serialization of Comment fix #8 --- .../java/wekan/wrapper/entity/Comment.java | 18 ++++++++++++++++++ .../wrapper/api/CardCommentServiceTest.java | 2 ++ 2 files changed, 20 insertions(+) diff --git a/wrapper/src/main/java/wekan/wrapper/entity/Comment.java b/wrapper/src/main/java/wekan/wrapper/entity/Comment.java index 3ae73fa..cef3fd1 100644 --- a/wrapper/src/main/java/wekan/wrapper/entity/Comment.java +++ b/wrapper/src/main/java/wekan/wrapper/entity/Comment.java @@ -7,7 +7,9 @@ import java.util.Date; public class Comment { @SerializedName("_id") private String id; + @SerializedName(value = "comment", alternate = "text") private String comment; + @SerializedName(value = "authorId", alternate = "userId") private String authorId; private String boardId; private String cardId; @@ -26,6 +28,22 @@ public class Comment { return authorId; } + public String getBoardId() { + return boardId; + } + + public String getCardId() { + return cardId; + } + + public Date getCreatedAt() { + return createdAt; + } + + public Date getModifiedAt() { + return modifiedAt; + } + @Override public String toString() { return "Comment{" + diff --git a/wrapper/src/test/java/wekan/wrapper/api/CardCommentServiceTest.java b/wrapper/src/test/java/wekan/wrapper/api/CardCommentServiceTest.java index 54fd35a..31ab537 100644 --- a/wrapper/src/test/java/wekan/wrapper/api/CardCommentServiceTest.java +++ b/wrapper/src/test/java/wekan/wrapper/api/CardCommentServiceTest.java @@ -103,6 +103,8 @@ public class CardCommentServiceTest { ).execute().body(); assertNotNull(comment); + assertNotNull(comment.getAuthorId()); + assertNotNull(comment.getComment()); } catch (IOException e) { e.printStackTrace(); }