Remove method to bookmark a post by ID.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 4 Nov 2014 18:46:49 +0000 (19:46 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 4 Nov 2014 18:46:49 +0000 (19:46 +0100)
src/main/java/net/pterodactylus/sone/database/BookmarkDatabase.java
src/main/java/net/pterodactylus/sone/database/memory/MemoryBookmarkDatabase.java
src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java
src/test/java/net/pterodactylus/sone/database/memory/MemoryBookmarkDatabaseTest.java

index dbcdb84..6eb9c38 100644 (file)
@@ -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);
index 78c8a4f..4c99c53 100644 (file)
@@ -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 {
index 6481a1b..18a5718 100644 (file)
@@ -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);
        }
index ce61ade..8a97593 100644 (file)
@@ -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));
-       }
-
 }