Search in sources :

Example 1 with BinderUserInformations

use of org.olat.modules.portfolio.BinderUserInformations in project OpenOLAT by OpenOLAT.

the class BinderUserInformationsDAOTest method updateBinderUserInformations.

@Test
public void updateBinderUserInformations() {
    Identity identity = JunitTestHelper.createAndPersistIdentityAsRndUser("bu-1");
    BinderImpl binder = binderDao.createAndPersist("Binder infos", "Binder with one section.", null, null);
    dbInstance.commitAndCloseSession();
    // update the infos
    binderUserInformationsDAO.updateBinderUserInformations(binder, identity);
    dbInstance.commit();
    // load the infos and check
    BinderUserInformations infos = binderUserInformationsDAO.getBinderUserInfos(binder, identity);
    Assert.assertNotNull(infos);
    Assert.assertNotNull(infos.getKey());
    Assert.assertNotNull(infos.getCreationDate());
    Assert.assertNotNull(infos.getLastModified());
    Assert.assertNotNull(infos.getInitialLaunch());
    Assert.assertNotNull(infos.getRecentLaunch());
    Assert.assertEquals(1, infos.getVisit());
    Assert.assertEquals(binder, infos.getBinder());
    Assert.assertEquals(identity, infos.getIdentity());
}
Also used : BinderUserInformations(org.olat.modules.portfolio.BinderUserInformations) BinderImpl(org.olat.modules.portfolio.model.BinderImpl) Identity(org.olat.core.id.Identity) Test(org.junit.Test)

Example 2 with BinderUserInformations

use of org.olat.modules.portfolio.BinderUserInformations in project openolat by klemens.

the class BinderUserInformationsDAOTest method updateBinderUserInformations.

@Test
public void updateBinderUserInformations() {
    Identity identity = JunitTestHelper.createAndPersistIdentityAsRndUser("bu-1");
    BinderImpl binder = binderDao.createAndPersist("Binder infos", "Binder with one section.", null, null);
    dbInstance.commitAndCloseSession();
    // update the infos
    binderUserInformationsDAO.updateBinderUserInformations(binder, identity);
    dbInstance.commit();
    // load the infos and check
    BinderUserInformations infos = binderUserInformationsDAO.getBinderUserInfos(binder, identity);
    Assert.assertNotNull(infos);
    Assert.assertNotNull(infos.getKey());
    Assert.assertNotNull(infos.getCreationDate());
    Assert.assertNotNull(infos.getLastModified());
    Assert.assertNotNull(infos.getInitialLaunch());
    Assert.assertNotNull(infos.getRecentLaunch());
    Assert.assertEquals(1, infos.getVisit());
    Assert.assertEquals(binder, infos.getBinder());
    Assert.assertEquals(identity, infos.getIdentity());
}
Also used : BinderUserInformations(org.olat.modules.portfolio.BinderUserInformations) BinderImpl(org.olat.modules.portfolio.model.BinderImpl) Identity(org.olat.core.id.Identity) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 Identity (org.olat.core.id.Identity)2 BinderUserInformations (org.olat.modules.portfolio.BinderUserInformations)2 BinderImpl (org.olat.modules.portfolio.model.BinderImpl)2