@Test
public void shouldCreateAListOfProducts() {

    // given
    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");
    // when
    Map<String, String> productNameList = tierResourceValidator.createProductList(tiers);
    // then
    assertNotNull(productNameList);
    assertEquals(3, productNameList.size());
}