From 45d69427a7c1300fb4841159c0e3b2c4489dab21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 4 Nov 2014 19:46:49 +0100 Subject: [PATCH] Remove method to bookmark a post by ID. --- .../java/net/pterodactylus/sone/database/BookmarkDatabase.java | 1 - .../sone/database/memory/MemoryBookmarkDatabase.java | 10 ---------- .../net/pterodactylus/sone/database/memory/MemoryDatabase.java | 5 ----- .../sone/database/memory/MemoryBookmarkDatabaseTest.java | 8 -------- 4 files changed, 24 deletions(-) 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)); - } - } -- 2.7.4