use of cz.metacentrum.perun.core.api.UserExtSource in project perun by CESNET.
the class AttributesManagerEntryIntegrationTest method setUserExtSourceAttributesWhenTypeMismatch.
@Test(expected = InternalErrorException.class)
public void setUserExtSourceAttributesWhenTypeMismatch() throws Exception {
System.out.println(CLASS_NAME + "setUserExtSourceAttributesWhenTypeMismatch");
UserExtSource ues = setUpUserExtSourceTest();
attributes = setUpUserExtSourceAttribute();
attributes.get(0).setValue(1);
// set wrong value - integer into string
attributesManager.setAttributes(sess, ues, attributes);
// shouldn't set wrong attribute
}
use of cz.metacentrum.perun.core.api.UserExtSource in project perun by CESNET.
the class AttributesManagerEntryIntegrationTest method removeUserExtSourceAttributes.
@Test
public void removeUserExtSourceAttributes() throws Exception {
System.out.println(CLASS_NAME + "removeUserExtSourceAttributes");
UserExtSource ues = setUpUserExtSourceTest();
attributes = setUpUserExtSourceAttribute();
attributesManager.setAttribute(sess, ues, attributes.get(0));
// create userExtSource and set attribute with value
attributesManager.removeAttributes(sess, ues, attributes);
// remove attributes from resource (definition or attribute)
List<Attribute> retAttr = attributesManager.getAttributes(sess, ues);
assertFalse("our user external source shouldn't have set our attribute", retAttr.contains(attributes.get(0)));
}
use of cz.metacentrum.perun.core.api.UserExtSource in project perun by CESNET.
the class AttributesManagerEntryIntegrationTest method removeUserExtSourceAttributeWhenAttributeNotExists.
@Test(expected = AttributeNotExistsException.class)
public void removeUserExtSourceAttributeWhenAttributeNotExists() throws Exception {
System.out.println(CLASS_NAME + "removeUserExtSourceAttributeWhenAttributeNotExists");
UserExtSource ues = setUpUserExtSourceTest();
attributes = setUpUserExtSourceAttribute();
attributes.get(0).setId(0);
attributesManager.removeAttribute(sess, ues, attributes.get(0));
// shouldn't find attribute
}
use of cz.metacentrum.perun.core.api.UserExtSource in project perun by CESNET.
the class AttributesManagerEntryIntegrationTest method removeAllUserExtSourceAttributes.
@Test
public void removeAllUserExtSourceAttributes() throws Exception {
System.out.println(CLASS_NAME + "removeAllUserExtSourceAttributes");
UserExtSource ues = setUpUserExtSourceTest();
attributes = setUpUserExtSourceAttribute();
attributesManager.setAttribute(sess, ues, attributes.get(0));
// create user external source and set attribute with value
attributesManager.removeAllAttributes(sess, ues);
// remove all attributes from user external source (definition or attribute)
List<Attribute> retAttr = attributesManager.getAttributes(sess, ues);
assertFalse("our user external source shouldn't have set our attribute", retAttr.contains(attributes.get(0)));
}
use of cz.metacentrum.perun.core.api.UserExtSource in project perun by CESNET.
the class AttributesManagerEntryIntegrationTest method removeUserExtSourceAttributesWhenAttributeNotExists.
@Test(expected = AttributeNotExistsException.class)
public void removeUserExtSourceAttributesWhenAttributeNotExists() throws Exception {
System.out.println(CLASS_NAME + "removeUserExtSourceAttributesWhenAttributeNotExists");
UserExtSource ues = setUpUserExtSourceTest();
attributes = setUpUserExtSourceAttribute();
attributes.get(0).setId(0);
attributesManager.removeAttributes(sess, ues, attributes);
// shouldn't find attribute
}
Aggregations