TierResourceValidatorImpl implements TierResourceValidator { Map<String, String> createProductList(List<Tier> tiers) { Map<String, String> productNameList = new HashMap<String, String>(); for (Tier tier : tiers) { for (ProductRelease productRelease : tier.getProductReleases()) { productNameList.put(productRelease.getName() + "-" + productRelease.getVersion(), ""); } } return productNameList; }  void validateCreate(ClaudiaData claudiaData, TierDto environmentDto, String vdc, String environmentName); void validateCreateAbstract(TierDto tierDto, String environmentName); void validateSecurityGroups(ClaudiaData claudiaData, TierDto tierDto); void validateUpdate(String vdc, String environmentName, String tierName, TierDto environmentDto); void validateDelete(String vdc, String environmentName, String tierName); void validateTiersDependencies(String environmentName, String vdc, Set<TierDto> tierDtoList); boolean checkTierProductsInDependencyList(List<String> productDependencies,
            Map<String, String> dependenciesMap); void setTierManager(TierManager tierManager); void setEnvironmentInstanceManager(EnvironmentInstanceManager environmentInstanceManager); void setEnvironmentManager(EnvironmentManager environmentManager); QuotaClient getQuotaClient(); void setQuotaClient(QuotaClient quotaClient); void setResourceValidator(ResourceValidator resourceValidator); void setProductValidator(ProductValidator productValidator);  }
@Test public void shouldCreateAListOfProducts() { TierResourceValidatorImpl tierResourceValidator = new TierResourceValidatorImpl(); List<Tier> tiers = new ArrayList<Tier>(); Tier tier1 = new Tier(); tiers.add(tier1); List<ProductRelease> products = new ArrayList<ProductRelease>(2); tier1.setProductReleases(products); ProductRelease product1 = new ProductRelease(); product1.setName("mongo"); product1.setVersion("1"); ProductRelease product2 = new ProductRelease(); product2.setName("mongoshared"); product2.setVersion("1"); products.add(product1); products.add(product2); Tier tier2 = new Tier(); tiers.add(tier2); List<ProductRelease> products2 = new ArrayList<ProductRelease>(2); tier2.setProductReleases(products2); ProductRelease product3 = new ProductRelease(); product3.setName("contexbroker"); product3.setVersion("1.0"); Set<Metadata> metadatas = new HashSet<Metadata>(2); product3.setMetadatas(metadatas); products2.add(product3); Metadata metadataDep = new Metadata(); metadatas.add(metadataDep); metadataDep.setKey("dep"); metadataDep.setValue("mongo-1"); Map<String, String> productNameList = tierResourceValidator.createProductList(tiers); assertNotNull(productNameList); assertEquals(3, productNameList.size()); }