Search in sources :

Example 1 with ExtSourcesManagerBl

use of cz.metacentrum.perun.core.bl.ExtSourcesManagerBl in project perun by CESNET.

the class urn_perun_group_attribute_def_def_groupExtSourceTest method setUp.

@Before
public void setUp() throws Exception {
    classInstance = new urn_perun_group_attribute_def_def_groupExtSource();
    attributeToCheck = new Attribute(classInstance.getAttributeDefinition());
    sess = mock(PerunSessionImpl.class);
    PerunBl perunBl = mock(PerunBl.class);
    when(sess.getPerunBl()).thenReturn(perunBl);
    GroupsManagerBl groupsManagerBl = mock(GroupsManagerBl.class);
    when(perunBl.getGroupsManagerBl()).thenReturn(groupsManagerBl);
    Vo groupVo = mock(Vo.class);
    VosManagerBl vosManagerBl = mock(VosManagerBl.class);
    when(perunBl.getVosManagerBl()).thenReturn(vosManagerBl);
    when(sess.getPerunBl().getVosManagerBl().getVoById(sess, group.getVoId())).thenReturn(groupVo);
    ExtSource extSource = new ExtSource(1, "my_example", "type");
    ExtSourcesManagerBl extSourcesManagerBl = mock(ExtSourcesManagerBl.class);
    when(sess.getPerunBl().getExtSourcesManagerBl()).thenReturn(extSourcesManagerBl);
    when(sess.getPerunBl().getExtSourcesManagerBl().getVoExtSources(sess, groupVo)).thenReturn(Collections.singletonList(extSource));
}
Also used : GroupsManagerBl(cz.metacentrum.perun.core.bl.GroupsManagerBl) Attribute(cz.metacentrum.perun.core.api.Attribute) VosManagerBl(cz.metacentrum.perun.core.bl.VosManagerBl) PerunBl(cz.metacentrum.perun.core.bl.PerunBl) Vo(cz.metacentrum.perun.core.api.Vo) ExtSource(cz.metacentrum.perun.core.api.ExtSource) ExtSourcesManagerBl(cz.metacentrum.perun.core.bl.ExtSourcesManagerBl) PerunSessionImpl(cz.metacentrum.perun.core.impl.PerunSessionImpl) Before(org.junit.Before)

Aggregations

Attribute (cz.metacentrum.perun.core.api.Attribute)1 ExtSource (cz.metacentrum.perun.core.api.ExtSource)1 Vo (cz.metacentrum.perun.core.api.Vo)1 ExtSourcesManagerBl (cz.metacentrum.perun.core.bl.ExtSourcesManagerBl)1 GroupsManagerBl (cz.metacentrum.perun.core.bl.GroupsManagerBl)1 PerunBl (cz.metacentrum.perun.core.bl.PerunBl)1 VosManagerBl (cz.metacentrum.perun.core.bl.VosManagerBl)1 PerunSessionImpl (cz.metacentrum.perun.core.impl.PerunSessionImpl)1 Before (org.junit.Before)1