in component-test/src/main/java/org/apache/fineract/cn/deposit/TestProductInstance.java [258:293]
public void shouldOpenAccountAfterUpdatingDefinition() throws Exception {
final ProductDefinition productDefinition = Fixture.productDefinition();
super.depositAccountManager.create(productDefinition);
super.eventRecorder.wait(EventConstants.POST_PRODUCT_DEFINITION, productDefinition.getIdentifier());
final ProductInstance productInstance = Fixture.productInstance(productDefinition.getIdentifier());
super.depositAccountManager.create(productInstance);
super.eventRecorder.wait(EventConstants.POST_PRODUCT_INSTANCE, productInstance.getCustomerIdentifier());
final Charge openingCharge = new Charge();
openingCharge.setActionIdentifier("Open");
openingCharge.setAmount(5.00D);
openingCharge.setName("Opening Account Charge");
openingCharge.setIncomeAccountIdentifier("10123");
openingCharge.setProportional(Boolean.TRUE);
productDefinition.setCharges(new HashSet<>(Arrays.asList(openingCharge)));
super.depositAccountManager.changeProductDefinition(productDefinition.getIdentifier(), productDefinition);
super.eventRecorder.wait(EventConstants.PUT_PRODUCT_DEFINITION, productDefinition.getIdentifier());
final List<ProductInstance> productInstances = super.depositAccountManager.fetchProductInstances(productInstance.getCustomerIdentifier());
final ProductInstance fetchedProductInstance = productInstances.get(0);
super.depositAccountManager.postProductInstanceCommand(
fetchedProductInstance.getAccountIdentifier(), EventConstants.ACTIVATE_PRODUCT_INSTANCE_COMMAND);
Assert.assertTrue(
super.eventRecorder.wait(EventConstants.ACTIVATE_PRODUCT_INSTANCE,
fetchedProductInstance.getAccountIdentifier()));
}