use of cz.metacentrum.perun.audit.events.AuditEvent in project perun by CESNET.
the class urn_perun_user_attribute_def_virt_tcsMails_muTest method resolveVirtualAttributeValueChangeRemoved2.
@Test
public void resolveVirtualAttributeValueChangeRemoved2() throws Exception {
AuditEvent userRem = new AttributeRemovedForUser(isMailAttr, user);
List<AuditEvent> msgs = classInstance.resolveVirtualAttributeValueChange(sess, userRem);
assertTrue("audit should contain change of tcsMails", msgs.get(0).getMessage().contains(expectedTestOfMessage));
}
use of cz.metacentrum.perun.audit.events.AuditEvent in project perun by CESNET.
the class urn_perun_user_attribute_def_virt_tcsMails_muTest method resolveVirtualAttributeValueChangeSet1.
@Test
public void resolveVirtualAttributeValueChangeSet1() throws Exception {
AuditEvent userSet = new AttributeSetForUser(preferredMailAttr, user);
List<AuditEvent> msgs = classInstance.resolveVirtualAttributeValueChange(sess, userSet);
assertTrue("audit should contain change of tcsMails", msgs.get(0).getMessage().contains(expectedTestOfMessage));
}
use of cz.metacentrum.perun.audit.events.AuditEvent in project perun by CESNET.
the class urn_perun_user_attribute_def_virt_tcsMails_muTest method resolveVirtualAttributeValueChangeSet3.
@Test
public void resolveVirtualAttributeValueChangeSet3() throws Exception {
AuditEvent userSet = new AttributeSetForUser(publicMailsAttr, user);
List<AuditEvent> msgs = classInstance.resolveVirtualAttributeValueChange(sess, userSet);
assertTrue("audit should contain change of tcsMails", msgs.get(0).getMessage().contains(expectedTestOfMessage));
}
use of cz.metacentrum.perun.audit.events.AuditEvent in project perun by CESNET.
the class urn_perun_user_attribute_def_virt_tcsMails_muTest method resolveVirtualAttributeValueChangeRemoved1.
@Test
public void resolveVirtualAttributeValueChangeRemoved1() throws Exception {
AuditEvent userRem = new AttributeRemovedForUser(preferredMailAttr, user);
List<AuditEvent> msgs = classInstance.resolveVirtualAttributeValueChange(sess, userRem);
assertTrue("audit should contain change of tcsMails", msgs.get(0).getMessage().contains(expectedTestOfMessage));
}
use of cz.metacentrum.perun.audit.events.AuditEvent in project perun by CESNET.
the class AuditMessagesManagerImpl method pollConsumerEvents.
@Override
public List<AuditEvent> pollConsumerEvents(PerunSession perunSession, String consumerName, int lastProcessedId) {
checkAuditerConsumerExists(perunSession, consumerName);
try {
List<AuditEvent> eventList = new ArrayList<>();
int maxId = getLastMessageId(perunSession);
if (maxId > lastProcessedId) {
// get events
eventList = jdbc.query("select " + auditMessageMappingSelectQuery + " from auditer_log where id > ? and id <= ? order by id", AUDIT_EVENT_MAPPER, lastProcessedId, maxId);
}
return eventList;
} catch (Exception ex) {
throw new InternalErrorException(ex);
}
}
Aggregations