ResourcePoolService implements IResourcePoolService { @Override public Set<String> getAllRPNames() { logger.debug("get all resource pool names."); List<VcResourcePoolEntity> rps = rpDao.findAllOrderByClusterName(); Set<String> result = new HashSet<String>(); for (VcResourcePoolEntity rp : rps) { result.add(rp.getName()); } logger.debug("got resource pool names: " + result); return result; }  IResourcePoolDAO getRpDao(); @Autowired void setRpDao(IResourcePoolDAO rpDao); IClusterDAO getClusterDao(); @Autowired void setClusterDao(IClusterDAO clusterDao); IResourceService getResService(); @Autowired void setResService(IResourceService resSvc); @Override List<VcCluster> getAllVcResourcePool(); @Override synchronized void addResourcePool(String rpName,
         String vcClusterName, String vcResourcePool); @Override List<VcCluster> getVcResourcePoolByName(String name); @Override List<VcCluster> getVcResourcePoolByNameList(String[] names); @Override Set<String> getAllRPNames(); @Override @Transactional List<ResourcePoolRead> getAllResourcePoolForRest(); @Override @Transactional ResourcePoolRead getResourcePoolForRest(final String rpName); @Override @Transactional synchronized void deleteResourcePool(final String rpName); @Override boolean isDeployedUnderCluster(final String clusterName,
         final String vcRPName); synchronized List<String> addAutoResourcePools(
         List<VcCluster> vcClusters, boolean ignoreDuplicate); @Override synchronized void updateResourcePool(String rpName,
         String vcClusterName, String vcResourcePool);  }
@Test(groups = { "res-mgmt" }) public void testGetAllRPNames() { new Expectations() { { List<VcResourcePoolEntity> rpEntities = new ArrayList<VcResourcePoolEntity>(); VcResourcePoolEntity rpEntity = new VcResourcePoolEntity(); rpEntity.setName("defaultRP"); rpEntity.setVcCluster("cluster-ws"); rpEntity.setVcResourcePool("jarred"); rpEntities.add(rpEntity); rpDao.findAllOrderByClusterName(); result = rpEntities; } }; rpSvc.setRpDao(rpDao); Set<String> rpNames = rpSvc.getAllRPNames(); Assert.assertNotNull(rpNames); Assert.assertEquals(rpNames.size(), 1); }