use of org.finos.waltz.model.bookmark.Bookmark in project waltz by khartec.
the class BookmarkServiceTest method bookmarksCanDeletedById.
@Test
public void bookmarksCanDeletedById() {
EntityReference bookmarkedEntity = mkAppRef();
Bookmark bookmark = createBookmark(bookmarkedEntity, "test bookmark1");
Long bookmarkId = bookmark.id().get();
assertEquals(bookmark, svc.getById(bookmarkId));
assertTrue(svc.deleteById(bookmark, mkUserId()));
assertNull(svc.getById(bookmarkId));
}
use of org.finos.waltz.model.bookmark.Bookmark in project waltz by khartec.
the class BookmarkServiceTest method bookmarksCanBeUpdated.
@Test
public void bookmarksCanBeUpdated() {
EntityReference bookmarkedEntity = mkAppRef();
Bookmark bookmark = createBookmark(bookmarkedEntity, "test bookmark1");
Long bookmarkId = bookmark.id().get();
assertEquals(bookmark, svc.getById(bookmarkId));
ImmutableBookmark updatedBookmark = ImmutableBookmark.copyOf(bookmark).withTitle("Updated").withLastUpdatedAt(DateTimeUtilities.today().atStartOfDay().plusHours(1));
svc.update(updatedBookmark, "admin");
assertEquals(updatedBookmark, svc.getById(bookmarkId));
}
use of org.finos.waltz.model.bookmark.Bookmark in project waltz by khartec.
the class BookmarkServiceTest method bookmarksAreAttachedToSpecificEntities.
@Test
public void bookmarksAreAttachedToSpecificEntities() {
EntityReference bookmarkedEntity = mkAppRef();
EntityReference anotherBookmarkedEntity = mkAppRef();
Bookmark bookmark1 = createBookmark(bookmarkedEntity, "test bookmark1");
Bookmark bookmark2 = createBookmark(anotherBookmarkedEntity, "test bookmark2");
List<Bookmark> bookmarksForFirstEntity = svc.findByReference(bookmarkedEntity);
assertEquals(1, bookmarksForFirstEntity.size());
assertTrue(bookmarksForFirstEntity.contains(bookmark1));
List<Bookmark> bookmarksForSecondEntity = svc.findByReference(anotherBookmarkedEntity);
assertEquals(1, bookmarksForSecondEntity.size());
assertTrue(bookmarksForSecondEntity.contains(bookmark2));
}
Aggregations