use of org.olat.modules.gotomeeting.GoToOrganizer in project OpenOLAT by OpenOLAT.
the class GoToMeetingDAOTest method loadMeetingByExternalId.
@Test
public void loadMeetingByExternalId() {
RepositoryEntry entry = JunitTestHelper.createAndPersistRepositoryEntry();
String username = UUID.randomUUID().toString();
String accessToken = UUID.randomUUID().toString();
String organizerKey = UUID.randomUUID().toString();
String externalId = UUID.randomUUID().toString();
GoToOrganizer organizer = organizerDao.createOrganizer(null, username, accessToken, organizerKey, "Levinus", "Memminger", null, null, 10l, null);
Assert.assertNotNull(organizer);
Date start = new Date();
Date end = new Date();
String trainingKey = Long.toString(CodeHelper.getForeverUniqueID());
GoToMeeting training = meetingDao.createTraining("Training by key", externalId, "Load training by external key", trainingKey, start, end, organizer, entry, "d9916", null);
dbInstance.commitAndCloseSession();
Assert.assertNotNull(training);
GoToMeeting reloadedTraining = meetingDao.loadMeetingByExternalId(externalId);
Assert.assertNotNull(reloadedTraining);
Assert.assertEquals(training, reloadedTraining);
}
use of org.olat.modules.gotomeeting.GoToOrganizer in project OpenOLAT by OpenOLAT.
the class GoToMeetingDAOTest method countMeetingsOrganizedBy.
@Test
public void countMeetingsOrganizedBy() {
RepositoryEntry entry = JunitTestHelper.createAndPersistRepositoryEntry();
String username = UUID.randomUUID().toString();
String accessToken = UUID.randomUUID().toString();
String organizerKey = UUID.randomUUID().toString();
String externalId = UUID.randomUUID().toString();
GoToOrganizer organizer = organizerDao.createOrganizer(null, username, accessToken, organizerKey, "Hans", "Pleydenwurff", null, null, 10l, null);
Assert.assertNotNull(organizer);
Date start = new Date();
Date end = new Date();
String trainingKey = Long.toString(CodeHelper.getForeverUniqueID());
GoToMeeting training = meetingDao.createTraining("Training by key", externalId, "Count the meetings organized by this organizer", trainingKey, start, end, organizer, entry, "d9916", null);
dbInstance.commitAndCloseSession();
Assert.assertNotNull(training);
int countOrganizersMeetings = meetingDao.countMeetingsOrganizedBy(organizer);
Assert.assertEquals(1, countOrganizersMeetings);
}
use of org.olat.modules.gotomeeting.GoToOrganizer in project OpenOLAT by OpenOLAT.
the class GoToMeetingDAOTest method createMeeting_without.
@Test
public void createMeeting_without() {
String username = UUID.randomUUID().toString();
String accessToken = UUID.randomUUID().toString();
String organizerKey = UUID.randomUUID().toString();
GoToOrganizer organizer = organizerDao.createOrganizer("My account", username, accessToken, organizerKey, "Lucas", "de Leyde", null, null, 10l, null);
Assert.assertNotNull(organizer);
Date start = new Date();
Date end = new Date();
String trainingKey = Long.toString(CodeHelper.getForeverUniqueID());
GoToMeeting training = meetingDao.createTraining("New training", null, "Very interessant", trainingKey, start, end, organizer, null, null, null);
dbInstance.commit();
Assert.assertNotNull(training);
Assert.assertNotNull(training.getKey());
Assert.assertNotNull(training.getCreationDate());
Assert.assertNotNull(training.getLastModified());
Assert.assertEquals("New training", training.getName());
Assert.assertEquals("Very interessant", training.getDescription());
Assert.assertNotNull(training.getStartDate());
Assert.assertNotNull(training.getEndDate());
}
use of org.olat.modules.gotomeeting.GoToOrganizer in project OpenOLAT by OpenOLAT.
the class GoToRegistrantDAOTest method getRegistrants.
@Test
public void getRegistrants() {
String token = UUID.randomUUID().toString();
Identity trainee = JunitTestHelper.createAndPersistIdentityAsRndUser("trainee-3");
GoToOrganizer organizer = organizerDao.createOrganizer(null, token, token, token, null, null, null, null, 10l, null);
Assert.assertNotNull(organizer);
Date start = new Date();
Date end = new Date();
String trainingKey = Long.toString(CodeHelper.getForeverUniqueID());
GoToMeeting training = meetingDao.createTraining("New training", null, "Very interessant", trainingKey, start, end, organizer, null, null, null);
dbInstance.commit();
// create registrant
String registrantKey = Long.toString(CodeHelper.getForeverUniqueID());
String joinUrl = "http://openolat.com/join/" + registrantKey;
String confirmUrl = "http://openolat.com/confirm/" + registrantKey;
GoToRegistrant registrant = registrantDao.createRegistrant(training, trainee, registrantKey, joinUrl, confirmUrl);
Assert.assertNotNull(registrant);
dbInstance.commit();
// load
List<GoToRegistrant> reloadRegistrants = registrantDao.getRegistrants(trainee, null, null, null);
Assert.assertNotNull(reloadRegistrants);
Assert.assertEquals(1, reloadRegistrants.size());
Assert.assertEquals(registrant, reloadRegistrants.get(0));
}
use of org.olat.modules.gotomeeting.GoToOrganizer in project OpenOLAT by OpenOLAT.
the class GoToOrganizerDAOTest method loadOrganizerByUsername.
@Test
public void loadOrganizerByUsername() {
String username = UUID.randomUUID().toString();
String accessToken = UUID.randomUUID().toString();
String organizerKey = UUID.randomUUID().toString();
GoToOrganizer organizer = organizerDao.createOrganizer(null, username, accessToken, organizerKey, "Anton", "Koberger", "anton@openolat.com", null, 10l, null);
dbInstance.commitAndCloseSession();
Assert.assertNotNull(organizer);
// load by user name
GoToOrganizer reloadedOrganizer = organizerDao.loadOrganizerByUsername(username);
Assert.assertNotNull(reloadedOrganizer);
Assert.assertEquals(organizer, reloadedOrganizer);
// check dummy user name
String randomName = UUID.randomUUID().toString();
GoToOrganizer dummyOrganizer = organizerDao.loadOrganizerByUsername(randomName);
Assert.assertNull(dummyOrganizer);
}
Aggregations