}
@Test
public void hostedVirtLimitSubUpdatesUnlimitedBonusVirtOnlyPool() {
when(configMock.getBoolean(ConfigProperties.STANDALONE)).thenReturn(false);
Subscription s = createVirtLimitSub("virtLimitProduct", 10, 10);
s.getProduct().setAttribute("virt_limit", "unlimited");
List<Pool> pools = poolRules.createPools(s);
assertEquals(2, pools.size());
Pool virtBonusPool = pools.get(1);
// Quantity on bonus pool should be unlimited:
assertEquals(new Long(-1), virtBonusPool.getQuantity());
// Now we update the sub and see if that unlimited pool gets adjusted:
s.getProduct().setAttribute("virt_limit", "10");
List<PoolUpdate> updates = poolRules.updatePools(s, pools);
assertEquals(2, updates.size());
PoolUpdate virtUpdate = updates.get(1);
assertEquals(new Long(100), virtUpdate.getPool().getQuantity());