use of org.olat.core.commons.services.license.LicenseType in project openolat by klemens.
the class LicenseTypeActivationDAOTest method shouldDeleteActivation.
@Test
public void shouldDeleteActivation() {
String name = "name";
LicenseType licenseType = licenseTypeDao.create(name);
licenseTypeDao.save(licenseType);
licenseTypeActivationDao.createAndPersist(LICENSE_HANDLER, licenseType);
dbInstance.commitAndCloseSession();
licenseTypeActivationDao.delete(LICENSE_HANDLER, licenseType);
dbInstance.commitAndCloseSession();
boolean isActive = licenseTypeActivationDao.isActive(LICENSE_HANDLER, licenseType);
assertThat(isActive).isFalse();
}
use of org.olat.core.commons.services.license.LicenseType in project openolat by klemens.
the class LicenseTypeActivationDAOTest method shouldCreateActivation.
@Test
public void shouldCreateActivation() {
String name = "name";
LicenseType licenseType = licenseTypeDao.create(name);
licenseTypeDao.save(licenseType);
dbInstance.commitAndCloseSession();
licenseTypeActivationDao.createAndPersist(LICENSE_HANDLER, licenseType);
dbInstance.commitAndCloseSession();
boolean isActive = licenseTypeActivationDao.isActive(LICENSE_HANDLER, licenseType);
assertThat(isActive).isTrue();
}
use of org.olat.core.commons.services.license.LicenseType in project openolat by klemens.
the class LicenseTypeActivationDAOTest method shouldNotCreateActivationIfItIsAlreadyActive.
@Test
public void shouldNotCreateActivationIfItIsAlreadyActive() {
String name = "name";
LicenseType licenseType = licenseTypeDao.create(name);
licenseTypeDao.save(licenseType);
licenseTypeActivationDao.createAndPersist(LICENSE_HANDLER, licenseType);
dbInstance.commitAndCloseSession();
licenseTypeActivationDao.createAndPersist(LICENSE_HANDLER, licenseType);
dbInstance.commitAndCloseSession();
boolean isActive = licenseTypeActivationDao.isActive(LICENSE_HANDLER, licenseType);
assertThat(isActive).isTrue();
}
use of org.olat.core.commons.services.license.LicenseType in project openolat by klemens.
the class LicenseTypeDAOTest method shouldLoadLicenseTypeByName.
@Test
public void shouldLoadLicenseTypeByName() {
LicenseType licenseType = licenseTypeDao.create(UUID.randomUUID().toString());
licenseType = licenseTypeDao.save(licenseType);
LicenseType otherLicenseType = licenseTypeDao.create(UUID.randomUUID().toString());
licenseTypeDao.save(otherLicenseType);
dbInstance.commitAndCloseSession();
LicenseType loadedLicenseType = licenseTypeDao.loadLicenseTypeByName(licenseType.getName());
assertThat(loadedLicenseType).isEqualTo(licenseType);
}
use of org.olat.core.commons.services.license.LicenseType in project openolat by klemens.
the class LicenseTypeDAOTest method shouldCreateLicenseType.
@Test
public void shouldCreateLicenseType() {
String name = "name";
LicenseType licenseType = licenseTypeDao.create(name);
assertThat(licenseType).isNotNull();
assertThat(licenseType.getName()).isEqualTo(name);
assertThat(licenseType.isPredefined()).isFalse();
assertThat(licenseType.getSortOrder()).isNotNull();
assertThat(licenseType.getCreationDate()).isNotNull();
assertThat(licenseType.getLastModified()).isNotNull();
}
Aggregations