Skip to content
Snippets Groups Projects
Commit 15a9061a authored by srosse's avatar srosse
Browse files

OO-4696: adapt the query to clean up the invitations

parent b3eda7f8
No related branches found
No related tags found
No related merge requests found
......@@ -317,7 +317,6 @@ public class InvitationDAO {
public void cleanUpInvitations() {
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
Date currentTime = cal.getTime();
cal.add(Calendar.HOUR, -6);
Date dateLimit = cal.getTime();
......@@ -328,7 +327,6 @@ public class InvitationDAO {
List<Invitation> oldInvitations = dbInstance.getCurrentEntityManager()
.createQuery(sb.toString(), Invitation.class)
.setParameter("currentDate", currentTime)
.setParameter("dateLimit", dateLimit)
.getResultList();
......
......@@ -19,7 +19,6 @@
*/
package org.olat.modules.portfolio.manager;
import java.util.Date;
import java.util.Locale;
import java.util.UUID;
......@@ -93,11 +92,9 @@ public class InvitationDAOTest extends OlatTestCase {
Assert.assertEquals(invitation.getToken(), reloadedInvitation.getToken());
}
@Test
public void hasInvitationPolicies_testHQL() {
String token = UUID.randomUUID().toString();
Date atDate = new Date();
boolean hasInvitation = invitationDao.hasInvitations(token);
Assert.assertFalse(hasInvitation);
}
......@@ -176,5 +173,13 @@ public class InvitationDAOTest extends OlatTestCase {
long numOfInvitations = invitationDao.countInvitations();
Assert.assertTrue(numOfInvitations > 0l);
}
/**
* Only check if the query is valid.
*/
@Test
public void cleanUpInvitations() {
invitationDao.cleanUpInvitations();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment