Pool pool = createPoolAndSub(createOwner(), prod, 1000L,
TestUtil.createDate(2009, 11, 30),
TestUtil.createDate(2015, 11, 30));
Owner owner = pool.getOwner();
Subscription sub = new Subscription(owner, prod,
new HashSet<Product>(), 2000L, TestUtil.createDate(2010, 2, 9),
TestUtil.createDate(3000, 2, 9), TestUtil.createDate(2010, 2, 12));
subCurator.create(sub);
assertTrue(pool.getQuantity() < sub.getQuantity());
assertTrue(pool.getStartDate() != sub.getStartDate());
assertTrue(pool.getEndDate() != sub.getEndDate());
pool.getSourceSubscription().setSubscriptionId(sub.getId());
poolCurator.merge(pool);
poolManager.getRefresher().add(owner).run();
pool = poolCurator.find(pool.getId());
assertEquals(sub.getId(), pool.getSubscriptionId());
assertEquals(sub.getQuantity(), pool.getQuantity());
assertEquals(sub.getStartDate(), pool.getStartDate());
assertEquals(sub.getEndDate(), pool.getEndDate());
}