ProductConfig { public List<Product> getProducts() { return products; } ProductConfig(List<Product> userConfig, Collection<DependencySeed> projectSeeds); boolean uniqueAttachIds(); List<Product> getProducts();  }
@Test public void testNoConfigAndNothingPublished() throws Exception { subject = new ProductConfig(null, projectSeeds); assertEquals(Collections.emptyList(), subject.getProducts()); }
@Test public void testNoConfigAndNoProductPublished() throws Exception { projectSeeds.add(otherSeed("feature.id", ArtifactType.TYPE_ECLIPSE_FEATURE)); subject = new ProductConfig(null, projectSeeds); assertEquals(Collections.emptyList(), subject.getProducts()); }
@Test public void testNoConfigDefaultsToPublishedProducts() throws Exception { projectSeeds.add(productSeed("product.id.1")); projectSeeds.add(productSeed("product.id.2")); projectSeeds.add(otherSeed("feature.id", ArtifactType.TYPE_ECLIPSE_FEATURE)); subject = new ProductConfig(null, projectSeeds); List<Product> products = subject.getProducts(); assertEquals(2, products.size()); assertTrue(products.contains(new Product("product.id.1"))); assertTrue(products.contains(new Product("product.id.2"))); }
@Test public void testExplicitProduct() throws Exception { projectSeeds.add(productSeed("product.id.1")); projectSeeds.add(productSeed("product.id.2")); List<Product> userConfig = Collections.singletonList(new Product("product.id.1")); subject = new ProductConfig(userConfig, projectSeeds); List<Product> expected = Arrays.asList(new Product("product.id.1")); assertEquals(expected, subject.getProducts()); }