From: David ‘Bombe’ Roden Date: Tue, 4 Nov 2014 18:46:49 +0000 (+0100) Subject: Remove method to bookmark a post by ID. X-Git-Tag: 0.9-rc1^2~3^2~49 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=45d69427a7c1300fb4841159c0e3b2c4489dab21;p=Sone.git Remove method to bookmark a post by ID. --- diff --git a/src/main/java/net/pterodactylus/sone/database/BookmarkDatabase.java b/src/main/java/net/pterodactylus/sone/database/BookmarkDatabase.java index dbcdb84..6eb9c38 100644 --- a/src/main/java/net/pterodactylus/sone/database/BookmarkDatabase.java +++ b/src/main/java/net/pterodactylus/sone/database/BookmarkDatabase.java @@ -11,7 +11,6 @@ import net.pterodactylus.sone.data.Post; */ public interface BookmarkDatabase { - void bookmarkPost(String postId); // FIXME – remove me void bookmarkPost(Post post); void unbookmarkPost(Post post); boolean isPostBookmarked(Post post); diff --git a/src/main/java/net/pterodactylus/sone/database/memory/MemoryBookmarkDatabase.java b/src/main/java/net/pterodactylus/sone/database/memory/MemoryBookmarkDatabase.java index 78c8a4f..4c99c53 100644 --- a/src/main/java/net/pterodactylus/sone/database/memory/MemoryBookmarkDatabase.java +++ b/src/main/java/net/pterodactylus/sone/database/memory/MemoryBookmarkDatabase.java @@ -46,16 +46,6 @@ public class MemoryBookmarkDatabase implements BookmarkDatabase { } @Override - public void bookmarkPost(String postId) { - lock.writeLock().lock(); - try { - bookmarkedPosts.add(postId); - } finally { - lock.writeLock().unlock(); - } - } - - @Override public void bookmarkPost(Post post) { lock.writeLock().lock(); try { diff --git a/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java b/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java index 6481a1b..18a5718 100644 --- a/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java +++ b/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java @@ -609,11 +609,6 @@ public class MemoryDatabase extends AbstractService implements Database { } @Override - public void bookmarkPost(String postId) { - memoryBookmarkDatabase.bookmarkPost(postId); - } - - @Override public void bookmarkPost(Post post) { memoryBookmarkDatabase.bookmarkPost(post); } diff --git a/src/test/java/net/pterodactylus/sone/database/memory/MemoryBookmarkDatabaseTest.java b/src/test/java/net/pterodactylus/sone/database/memory/MemoryBookmarkDatabaseTest.java index ce61ade..8a97593 100644 --- a/src/test/java/net/pterodactylus/sone/database/memory/MemoryBookmarkDatabaseTest.java +++ b/src/test/java/net/pterodactylus/sone/database/memory/MemoryBookmarkDatabaseTest.java @@ -87,12 +87,4 @@ public class MemoryBookmarkDatabaseTest { } } - @Test - public void addingABookmarkByIdBookmarksTheCorrectPost() { - Post randomPost = posts.values().iterator().next(); - bookmarkDatabase.bookmarkPost(randomPost.getId()); - assertThat(bookmarkDatabase.getBookmarkedPosts(), - contains(randomPost)); - } - }