RegionFacadeEjb implements RegionFacade { @Override public List<RegionReferenceDto> getAllActiveAsReference() { return regionService.getAllActive(Region.NAME, true).stream().map(f -> toReferenceDto(f)).collect(Collectors.toList()); }  @Override List<RegionReferenceDto> getAllActiveByArea(String areaUuid); @Override List<RegionReferenceDto> getAllActiveAsReference(); @Override List<RegionDto> getAllAfter(Date date); @Override List<RegionIndexDto> getIndexList(RegionCriteria criteria, Integer first, Integer max, List<SortProperty> sortProperties); @Override long count(RegionCriteria criteria); @Override List<String> getAllUuids(); @Override RegionDto getRegionByUuid(String uuid); @Override List<RegionDto> getByUuids(List<String> uuids); @Override RegionReferenceDto getRegionReferenceByUuid(String uuid); @Override RegionReferenceDto getRegionReferenceById(int id); @Override List<String> getNamesByIds(List<Long> regionIds); @Override void archive(String regionUuid); @Override void dearchive(String regionUuid); @Override boolean isUsedInOtherInfrastructureData(Collection<String> regionUuids); static RegionReferenceDto toReferenceDto(Region entity); RegionDto toDto(Region entity); RegionIndexDto toIndexDto(Region entity); @Override void saveRegion(RegionDto dto); @Override List<RegionReferenceDto> getByName(String name, boolean includeArchivedEntities);  }
@Test public void testGetAllActiveAsReference() { creator.createRegion("r1"); Region r2 = creator.createRegion("r2"); getRegionFacade().archive(r2.getUuid()); assertEquals(1, getRegionFacade().getAllActiveAsReference().size()); }