diff --git a/src/main/java/com/tumblr/jumblr/types/Blog.java b/src/main/java/com/tumblr/jumblr/types/Blog.java index 43c28e5..a0b203f 100644 --- a/src/main/java/com/tumblr/jumblr/types/Blog.java +++ b/src/main/java/com/tumblr/jumblr/types/Blog.java @@ -12,7 +12,7 @@ public class Blog extends Resource { private String name; private String title; private String description; - private int posts, likes, followers; + private int posts, likes, followers, drafts, queue; private Long updated; private boolean ask, ask_anon; @@ -56,6 +56,22 @@ public Integer getLikeCount() { return this.likes; } + /** + * Get the number of drafts for this blog + * @return int the number of drafts + */ + public Integer getDraftCount() { + return this.drafts; + } + + /** + * Get the number of Queued Posts for this blog + * @return int the number of Queued Posts + */ + public Integer getQueuedCount() { + return this.queue; + } + /** * Get the time of the most recent post (in seconds since epoch) * @return Long of time @@ -211,4 +227,4 @@ public void setName(String name) { this.name = name; } -} \ No newline at end of file +} diff --git a/src/test/java/com/tumblr/jumblr/types/BlogTest.java b/src/test/java/com/tumblr/jumblr/types/BlogTest.java index 03b394a..35fcbce 100644 --- a/src/test/java/com/tumblr/jumblr/types/BlogTest.java +++ b/src/test/java/com/tumblr/jumblr/types/BlogTest.java @@ -21,7 +21,7 @@ public class BlogTest extends TypeTest { Blog blog; private String name = "name.com", title = "title", description = "desc"; - private Integer posts = 10, likes = 11, followers = 10; + private Integer posts = 10, likes = 11, followers = 10, drafts = 9, queue = 8; private Long updated = 123456L; private Boolean ask = false, ask_anon = true; @@ -37,6 +37,8 @@ public void setup() throws IOException { flat.put("ask", ask); flat.put("ask_anon", ask_anon); flat.put("followers", followers); + flat.put("drafts", drafts); + flat.put("queue", queue); Gson gson = new Gson(); blog = gson.fromJson(flatSerialize(flat), Blog.class); @@ -62,6 +64,8 @@ public void testReaders() { assertEquals(title, blog.getTitle()); assertEquals(name, blog.getName()); assertEquals(followers, blog.getFollowersCount()); + assertEquals(drafts, blog.getDraftCount()); + assertEquals(queue, blog.getQueuedCount()); } @Test