ResourcePoolService implements IResourcePoolService { @Override public boolean isDeployedUnderCluster(final String clusterName, final String vcRPName) { if (VcResourceUtils.findRPInVCCluster(clusterName, vcRPName) != null) { return false; } else if ((VcResourceUtils.findRPInVCCluster(clusterName, "") != null) && ("[" + clusterName + "]").equals(vcRPName)) { return true; } else { return false; } }  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 testIsDeployedUnderCluster() { Assert.assertTrue(rpSvc.isDeployedUnderCluster("cluster1", "[cluster1]")); Assert.assertFalse(rpSvc.isDeployedUnderCluster("cluster1", "rp1")); Assert.assertFalse(rpSvc.isDeployedUnderCluster("cluster1", "rp2")); }