use of org.olat.resource.accesscontrol.provider.auto.model.AdvanceOrderImpl in project openolat by klemens.
the class AdvanceOrderDAO method create.
AdvanceOrder create(Identity identity, IdentifierKey key, String identifierValue, AccessMethod method) {
AdvanceOrderImpl advanceOrder = new AdvanceOrderImpl();
Date creationDate = new Date();
advanceOrder.setCreationDate(creationDate);
advanceOrder.setLastModified(creationDate);
advanceOrder.setIdentity(identity);
advanceOrder.setIdentifierKey(key);
advanceOrder.setIdentifierValue(identifierValue);
advanceOrder.setStatus(Status.PENDING);
advanceOrder.setStatusModified(creationDate);
advanceOrder.setMethod(method);
return advanceOrder;
}
use of org.olat.resource.accesscontrol.provider.auto.model.AdvanceOrderImpl in project OpenOLAT by OpenOLAT.
the class AdvanceOrderDAO method create.
AdvanceOrder create(Identity identity, IdentifierKey key, String identifierValue, AccessMethod method) {
AdvanceOrderImpl advanceOrder = new AdvanceOrderImpl();
Date creationDate = new Date();
advanceOrder.setCreationDate(creationDate);
advanceOrder.setLastModified(creationDate);
advanceOrder.setIdentity(identity);
advanceOrder.setIdentifierKey(key);
advanceOrder.setIdentifierValue(identifierValue);
advanceOrder.setStatus(Status.PENDING);
advanceOrder.setStatusModified(creationDate);
advanceOrder.setMethod(method);
return advanceOrder;
}
use of org.olat.resource.accesscontrol.provider.auto.model.AdvanceOrderImpl in project OpenOLAT by OpenOLAT.
the class AutoAccessManagerImplTest method shouldNotGrantAccessIfAlreadyDone.
@Test
public void shouldNotGrantAccessIfAlreadyDone() {
Collection<AdvanceOrder> advanceOrders = new ArrayList<>();
AdvanceOrderImpl doneAdvanceOrder = new AdvanceOrderImpl();
doneAdvanceOrder.setStatus(Status.DONE);
doneAdvanceOrder.setIdentifierKey(IdentifierKey.externalId);
doneAdvanceOrder.setIdentifierValue("abc");
advanceOrders.add(doneAdvanceOrder);
sut.grantAccess(advanceOrders);
verify(identifierHandlerMock, never()).findRepositoryEntries(any(IdentifierKey.class), anyString());
}
use of org.olat.resource.accesscontrol.provider.auto.model.AdvanceOrderImpl in project OpenOLAT by OpenOLAT.
the class AutoAccessManagerImplTest method getPendingAdvanceOrders.
private Collection<AdvanceOrder> getPendingAdvanceOrders() {
Collection<AdvanceOrder> advanceOrders;
AdvanceOrderImpl ao1 = new AdvanceOrderImpl();
ao1.setIdentifierKey(IdentifierKey.internalId);
ao1.setIdentifierValue("abc");
ao1.setStatus(Status.PENDING);
ao1.setMethod(accessMethodDummy);
ao1.setIdentity(IDENTITY);
AdvanceOrderImpl ao2 = new AdvanceOrderImpl();
ao2.setIdentifierKey(IdentifierKey.internalId);
ao2.setIdentifierValue("abc3");
ao2.setStatus(Status.PENDING);
ao2.setMethod(accessMethodDummy);
ao2.setIdentity(IDENTITY);
advanceOrders = Arrays.asList(ao1, ao2);
return advanceOrders;
}
use of org.olat.resource.accesscontrol.provider.auto.model.AdvanceOrderImpl in project openolat by klemens.
the class AutoAccessManagerImplTest method shouldNotGrantAccessIfAlreadyDone.
@Test
public void shouldNotGrantAccessIfAlreadyDone() {
Collection<AdvanceOrder> advanceOrders = new ArrayList<>();
AdvanceOrderImpl doneAdvanceOrder = new AdvanceOrderImpl();
doneAdvanceOrder.setStatus(Status.DONE);
doneAdvanceOrder.setIdentifierKey(IdentifierKey.externalId);
doneAdvanceOrder.setIdentifierValue("abc");
advanceOrders.add(doneAdvanceOrder);
sut.grantAccess(advanceOrders);
verify(identifierHandlerMock, never()).findRepositoryEntries(any(IdentifierKey.class), anyString());
}
Aggregations