From: David ‘Bombe’ Roden Date: Tue, 4 Nov 2014 19:05:07 +0000 (+0100) Subject: Add tests for starting and stopping the bookmark database. X-Git-Tag: 0.9-rc1^2~3^2~47 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ee2aef900b4a7ebabac8f3e42b0d3ec6447bfe98;p=Sone.git Add tests for starting and stopping the bookmark database. --- 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)); + } + }