use of cz.metacentrum.perun.audit.events.AuditEvent in project perun by CESNET.
the class urn_perun_user_attribute_def_virt_tcsMails_muTest method resolveVirtualAttributeValueChangeRemoved3.
@Test
public void resolveVirtualAttributeValueChangeRemoved3() throws Exception {
AuditEvent userRem = new AttributeRemovedForUser(publicMailsAttr, 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 resolveVirtualAttributeValueChangeRemoved4.
@Test
public void resolveVirtualAttributeValueChangeRemoved4() throws Exception {
AuditEvent userRem = new AttributeRemovedForUser(privateMailsAttr, 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_institutionsCountriesTest method resolveVirtualAttributeValueChange2.
@Test
public void resolveVirtualAttributeValueChange2() throws Exception {
setSchacHomeOrgs("muni.cz;cesnet.cz");
String czech_republic = "Czech Republic";
dnsMap.put(".cz", czech_republic);
AttributeDefinition countries = classInstance.getAttributeDefinition();
when(sess.getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, "urn:perun:user:attribute-def:virt:institutionsCountries")).thenReturn(countries);
Attribute newval = new Attribute(new urn_perun_entityless_attribute_def_def_dnsStateMapping().getAttributeDefinition());
newval.setValue(czech_republic);
when(sess.getPerunBl().getUsersManagerBl().findUsersWithExtSourceAttributeValueEnding(eq(sess), eq(SCHAC_HOME_ATTR_NAME), eq(".cz"), any())).thenReturn(Collections.singletonList(user));
AuditEvent event = new AttributeSetForKey(newval, ".cz");
List<AuditEvent> msgs = classInstance.resolveVirtualAttributeValueChange(sess, event);
assertTrue("audit should contain change of institutionsCountries", msgs.get(0).getMessage().contains("friendlyName=<institutionsCountries>"));
}
Aggregations