import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
}
@Test
+ public void bookmarkingAPostSavesTheDatabase() {
+ for (Post post : posts.values()) {
+ bookmarkDatabase.bookmarkPost(post);
+ }
+ verify(configurationLoader, times(posts.size()))
+ .saveBookmarkedPosts(any(Set.class));
+ }
+
+ @Test
public void removingABookmarkRemovesTheCorrectBookmark() {
Set<Post> allPosts = new HashSet<Post>(posts.values());
for (Post post : allPosts) {