From ee2aef900b4a7ebabac8f3e42b0d3ec6447bfe98 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 4 Nov 2014 20:05:07 +0100 Subject: [PATCH] Add tests for starting and stopping the bookmark database. --- .../sone/database/memory/MemoryBookmarkDatabaseTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 8a97593..28cd200 100644 --- a/src/test/java/net/pterodactylus/sone/database/memory/MemoryBookmarkDatabaseTest.java +++ b/src/test/java/net/pterodactylus/sone/database/memory/MemoryBookmarkDatabaseTest.java @@ -4,8 +4,10 @@ import static com.google.common.base.Optional.fromNullable; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.is; +import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import java.util.HashMap; @@ -87,4 +89,16 @@ public class MemoryBookmarkDatabaseTest { } } + @Test + public void startingTheDatabaseLoadsBookmarkedPosts() { + bookmarkDatabase.start(); + verify(configurationLoader).loadBookmarkedPosts(); + } + + @Test + public void stoppingTheDatabaseSavesTheBookmarkedPosts() { + bookmarkDatabase.stop(); + verify(configurationLoader).saveBookmarkedPosts(any(Set.class)); + } + } -- 2.7.4