assertEquals(2, updates.get(0).getPool().getDerivedProvidedProducts().size());
}
@Test
public void productIdChangeOnProductPoolAttributeTriggersUpdate() {
Subscription s = TestUtil.createSubscription(owner, TestUtil.createProduct());
String testAttributeKey = "multi-entitlement";
s.getProduct().setAttribute(testAttributeKey, "yes");
Pool p = TestUtil.copyFromSub(s);
p.setProductAttribute(testAttributeKey, "yes", s.getProduct().getId());
// Change the sub's product's ID
String expectedProductId = "NEW_TEST_ID";
s.getProduct().setId(expectedProductId);
when(productAdapterMock.getProductById(s.getProduct().getId()))
.thenReturn(s.getProduct());
List<Pool> existingPools = new LinkedList<Pool>();
existingPools.add(p);
List<PoolUpdate> updates = this.poolRules.updatePools(s, existingPools);