use of org.kie.workbench.common.screens.library.api.OrganizationalUnitRepositoryInfo in project kie-wb-common by kiegroup.
the class LibraryServiceImpl method getOrganizationalUnitRepositoryInfo.
@Override
public OrganizationalUnitRepositoryInfo getOrganizationalUnitRepositoryInfo(final OrganizationalUnit selectedOrganizationalUnit) {
if (selectedOrganizationalUnit == null) {
return null;
}
final List<OrganizationalUnit> organizationalUnits = getOrganizationalUnits();
final OrganizationalUnit organizationalUnit = getOrganizationalUnit(selectedOrganizationalUnit.getIdentifier(), organizationalUnits).get();
final List<Repository> repositories = new ArrayList<>(organizationalUnit.getRepositories());
return new OrganizationalUnitRepositoryInfo(organizationalUnits, organizationalUnit, repositories);
}
use of org.kie.workbench.common.screens.library.api.OrganizationalUnitRepositoryInfo in project kie-wb-common by kiegroup.
the class LibraryServiceImplTest method getDefaultOrganizationalUnitRepositoryInfoTest.
@Test
public void getDefaultOrganizationalUnitRepositoryInfoTest() {
final OrganizationalUnitRepositoryInfo info = mock(OrganizationalUnitRepositoryInfo.class);
doReturn(info).when(libraryService).getOrganizationalUnitRepositoryInfo(any(OrganizationalUnit.class));
assertEquals(info, libraryService.getDefaultOrganizationalUnitRepositoryInfo());
}
Aggregations