targetProduct.getAttributes().clear();
targetProduct.setAttribute("A1", "V1");
targetProduct.setAttribute("A2", "V2");
Subscription sourceSub = TestUtil.createSubscription(targetProduct);
Pool targetPool = TestUtil.createPool(targetProduct);
// createPool will simulate the copy automatically - reset them.
targetPool.setProductAttributes(new HashSet<ProductPoolAttribute>());
PoolHelper ph = new PoolHelper(pm, productCache, null);
when(psa.getProductById(targetProduct.getId())).thenReturn(targetProduct);
assertTrue("Update expected.",
ph.copyProductAttributesOntoPool(sourceSub.getProduct().getId(), targetPool));
assertEquals(2, targetPool.getProductAttributes().size());
assertTrue(targetPool.hasProductAttribute("A1"));
assertTrue(targetPool.hasProductAttribute("A2"));
}