use of org.olat.modules.webFeed.Feed in project openolat by klemens.
the class FeedManagerImplTest method enrichFeedFromRepositoryEntryShouldReturnNullIfFeedIsNull.
@Test
public void enrichFeedFromRepositoryEntryShouldReturnNullIfFeedIsNull() {
RepositoryEntry entry = new RepositoryEntry();
Feed enrichedFeed = sut.enrichFeedByRepositoryEntry(null, entry);
assertThat(enrichedFeed).isNull();
}
use of org.olat.modules.webFeed.Feed in project openolat by klemens.
the class FeedManagerImplTest method enrichFeedFromRepositoryEntryShouldTransferAtributes.
@Test
public void enrichFeedFromRepositoryEntryShouldTransferAtributes() {
Feed feed = new FeedImpl(resourceDummy);
RepositoryEntry entry = new RepositoryEntry();
String title = "Title";
entry.setDisplayname(title);
String description = "Description";
entry.setDescription(description);
String authors = "Author";
entry.setAuthors(authors);
Feed enrichedFeed = sut.enrichFeedByRepositoryEntry(feed, entry);
assertThat(enrichedFeed.getTitle()).isEqualTo(title);
assertThat(enrichedFeed.getDescription()).isEqualTo(description);
assertThat(enrichedFeed.getAuthor()).isEqualTo(authors);
}
use of org.olat.modules.webFeed.Feed in project openolat by klemens.
the class ItemDAOTest method createItem.
@Test
public void createItem() {
OLATResource resource = JunitTestHelper.createRandomResource();
Feed feed = feedDao.createFeedForResourcable(resource);
dbInstance.commitAndCloseSession();
Item item = itemDao.createItem(feed);
dbInstance.commitAndCloseSession();
// check values
assertThat(item.getKey()).isNotNull();
assertThat(item.getCreationDate()).isNotNull();
assertThat(item.getLastModified()).isNotNull();
assertThat(item.getFeed()).isEqualTo(feed);
}
use of org.olat.modules.webFeed.Feed in project openolat by klemens.
the class ItemDAOTest method loadItemByGuid_Feed_null.
@Test
public void loadItemByGuid_Feed_null() {
OLATResource resource = JunitTestHelper.createRandomResource();
Feed feed = feedDao.createFeedForResourcable(resource);
dbInstance.commitAndCloseSession();
// create an item
String guid = "guid-123";
Item tempItem = new ItemImpl(feed);
tempItem.setGuid(guid);
itemDao.createItem(feed, tempItem);
dbInstance.commitAndCloseSession();
// reload the item from the database
Item item = itemDao.loadItemByGuid(null, guid);
// check values
assertThat(item).isNull();
}
use of org.olat.modules.webFeed.Feed in project openolat by klemens.
the class ItemDAOTest method createItem_Feed_Item.
@Test
public void createItem_Feed_Item() {
OLATResource resource = JunitTestHelper.createRandomResource();
Feed feed = feedDao.createFeedForResourcable(resource);
dbInstance.commitAndCloseSession();
Item tempItem = new ItemImpl(feed);
Item item = itemDao.createItem(feed, tempItem);
dbInstance.commitAndCloseSession();
// check values
assertThat(item.getKey()).isNotNull();
assertThat(item.getCreationDate()).isNotNull();
assertThat(item.getLastModified()).isNotNull();
assertThat(item.getFeed()).isEqualTo(feed);
}
Aggregations