Search in sources :

Example 6 with LectureParticipantSummaryImpl

use of org.olat.modules.lecture.model.LectureParticipantSummaryImpl in project openolat by klemens.

the class LectureParticipantSummaryDAOTest method updateSummary.

@Test
public void updateSummary() {
    RepositoryEntry entry = JunitTestHelper.createAndPersistRepositoryEntry();
    Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("summary-3");
    // null must be accepted
    lectureParticipantSummaryDao.createSummary(entry, id, new Date());
    dbInstance.commitAndCloseSession();
    int numOfUpdatedRows = lectureParticipantSummaryDao.updateCalendarSynchronization(entry, id);
    Assert.assertEquals(1, numOfUpdatedRows);
    dbInstance.commitAndCloseSession();
    LectureParticipantSummaryImpl summary = (LectureParticipantSummaryImpl) lectureParticipantSummaryDao.getSummary(entry, id);
    Assert.assertNotNull(summary);
    Assert.assertNotNull(summary.getKey());
    Assert.assertTrue(summary.isCalendarSync());
    Assert.assertNotNull(summary.getCalendarLastSyncDate());
}
Also used : LectureParticipantSummaryImpl(org.olat.modules.lecture.model.LectureParticipantSummaryImpl) RepositoryEntry(org.olat.repository.RepositoryEntry) Identity(org.olat.core.id.Identity) Date(java.util.Date) Test(org.junit.Test)

Aggregations

Date (java.util.Date)6 LectureParticipantSummaryImpl (org.olat.modules.lecture.model.LectureParticipantSummaryImpl)6 Test (org.junit.Test)4 Identity (org.olat.core.id.Identity)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 LectureParticipantSummary (org.olat.modules.lecture.LectureParticipantSummary)2