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));
}
Aggregations