Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/main/java/com/tumblr/jumblr/types/Blog.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -211,4 +227,4 @@ public void setName(String name) {
this.name = name;
}

}
}
6 changes: 5 additions & 1 deletion src/test/java/com/tumblr/jumblr/types/BlogTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand All @@ -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
Expand Down