Merge pull request #953 from vishwasbabu/develop

updating test cases for financial activity accounts and accounts transfe...
This commit is contained in:
Vishwas Babu A J
2014-06-16 16:34:36 -07:00
14 changed files with 559 additions and 593 deletions
@@ -13,9 +13,14 @@ import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRul
*/
public class DuplicateFinancialActivityAccountFoundException extends AbstractPlatformDomainRuleException {
private final static String errorCode = "error.msg.financialActivityAccount.exists";
public DuplicateFinancialActivityAccountFoundException(final Integer financialActivityType) {
super("error.msg.financialActivityAccount.exists.for.office", "Mapping for activity already exists " + financialActivityType,
financialActivityType);
super(errorCode, "Mapping for activity already exists " + financialActivityType, financialActivityType);
}
public static String getErrorcode() {
return errorCode;
}
}
@@ -15,11 +15,17 @@ import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRul
*/
public class FinancialActivityAccountInvalidException extends AbstractPlatformDomainRuleException {
private final static String errorCode = "error.msg.financialActivityAccount.invalid";
public FinancialActivityAccountInvalidException(final FINANCIAL_ACTIVITY financialActivity, final GLAccount glAccount) {
super("error.msg.financialActivityAccount.invalid", "Financial Activity '" + financialActivity.getCode() + "' with Id :"
+ financialActivity.getValue() + "' can only be associated with a Ledger Account of Type "
+ financialActivity.getMappedGLAccountType().getCode() + " the provided Ledger Account '" + glAccount.getName() + "("
+ glAccount.getGlCode() + ")' does not of the required type", financialActivity.getCode(), financialActivity.getValue(),
financialActivity.getMappedGLAccountType().getCode(), glAccount.getName(), glAccount.getGlCode());
super(errorCode, "Financial Activity '" + financialActivity.getCode() + "' with Id :" + financialActivity.getValue()
+ "' can only be associated with a Ledger Account of Type " + financialActivity.getMappedGLAccountType().getCode()
+ " the provided Ledger Account '" + glAccount.getName() + "(" + glAccount.getGlCode()
+ ")' does not of the required type", financialActivity.getCode(), financialActivity.getValue(), financialActivity
.getMappedGLAccountType().getCode(), glAccount.getName(), glAccount.getGlCode());
}
public static String getErrorcode() {
return errorCode;
}
}