@Test public void testSetStartBookmark() throws Exception { Bookmark bookmark = new Bookmark(); bookmark.setText("My Bookmark Text"); Mockito.when(m_mockDesktop.createBookmark()).thenReturn(bookmark); IBookmarkService s = BEANS.get(IBookmarkService.class); Assert.assertNotNull(s); s.setStartBookmark(); // Get the Bookmark Bookmark startBookmark = s.getStartBookmark(); assertEquals("Kind", Bookmark.USER_BOOKMARK, startBookmark.getKind()); assertEquals("Text", "My Bookmark Text", startBookmark.getText()); }
@Test public void testDeleteBookmark() throws Exception { Bookmark bookmark = new Bookmark(); bookmark.setText("My Bookmark Text"); Mockito.when(m_mockDesktop.createBookmark()).thenReturn(bookmark); IBookmarkService s = BEANS.get(IBookmarkService.class); Assert.assertNotNull(s); s.setStartBookmark(); // Get the Bookmark Bookmark startBookmark = s.getStartBookmark(); assertNotNull(startBookmark); // Delete the bookmark s.deleteStartBookmark(); startBookmark = s.getStartBookmark(); assertNull(startBookmark); }