use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurAccountValidationServiceTest method isSubAccountInactive.
@Test
public void isSubAccountInactive() {
ValidationResult validationResult = concurAccountValidationService.checkSubAccount(ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.VALID_ACCT_NBR, ConcurAccountValidationTestConstants.INACTIVE_SUB_ACCT);
String subAccountErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.SUB_ACCOUNT_NUMBER, ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.VALID_ACCT_NBR, ConcurAccountValidationTestConstants.INACTIVE_SUB_ACCT);
Assert.assertFalse("Validation was expected to fail but returned true", validationResult.isValid());
Assert.assertEquals("Error message was expected for inactive sub account", MessageFormat.format(concurAccountValidationService.getConfigurationService().getPropertyValueAsString(KFSKeyConstants.ERROR_INACTIVE), subAccountErrorMessageString) + KFSConstants.NEWLINE, validationResult.getErrorMessagesAsOneFormattedString());
}
use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurAccountValidationServiceTest method isAccountingStringAccountInactive.
@Test
public void isAccountingStringAccountInactive() {
concurAccountInfo.setAccountNumber(ConcurAccountValidationTestConstants.INACTIVE_ACCT_NBR);
String accountErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.ACCOUNT_NUMBER, ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.INACTIVE_ACCT_NBR);
ValidationResult validationResult = concurAccountValidationService.validateConcurAccountInfo(concurAccountInfo);
Assert.assertFalse("Validation was expected to fail but returned true", validationResult.isValid());
Assert.assertEquals("One error message was expected for inactive account", MessageFormat.format(concurAccountValidationService.getConfigurationService().getPropertyValueAsString(KFSKeyConstants.ERROR_INACTIVE), accountErrorMessageString) + KFSConstants.NEWLINE, validationResult.getErrorMessagesAsOneFormattedString());
}
use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurAccountValidationServiceTest method isSubAccountBad.
@Test
public void isSubAccountBad() {
ValidationResult validationResult = concurAccountValidationService.checkSubAccount(ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.VALID_ACCT_NBR, ConcurAccountValidationTestConstants.BAD_SUB_ACCT);
String subAccountErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.SUB_ACCOUNT_NUMBER, ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.VALID_ACCT_NBR, ConcurAccountValidationTestConstants.BAD_SUB_ACCT);
Assert.assertFalse("Validation was expected to fail but returned true", validationResult.isValid());
Assert.assertEquals("Error message was expected for bad sub account", MessageFormat.format(concurAccountValidationService.getConfigurationService().getPropertyValueAsString(KFSKeyConstants.ERROR_EXISTENCE), subAccountErrorMessageString) + KFSConstants.NEWLINE, validationResult.getErrorMessagesAsOneFormattedString());
}
use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurAccountValidationServiceTest method isSubAccountAccountBad.
@Test
public void isSubAccountAccountBad() {
ValidationResult validationResult = concurAccountValidationService.checkSubAccount(ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.BAD_ACCT_NBR, ConcurAccountValidationTestConstants.VALID_SUB_ACCT);
String subAccountErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.SUB_ACCOUNT_NUMBER, ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.BAD_ACCT_NBR, ConcurAccountValidationTestConstants.VALID_SUB_ACCT);
Assert.assertFalse("Validation was expected to fail but returned true", validationResult.isValid());
Assert.assertEquals("Error message was expected for bad sub account", MessageFormat.format(concurAccountValidationService.getConfigurationService().getPropertyValueAsString(KFSKeyConstants.ERROR_EXISTENCE), subAccountErrorMessageString) + KFSConstants.NEWLINE, validationResult.getErrorMessagesAsOneFormattedString());
}
use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurAccountValidationServiceTest method isSubObjectCodeObjectBad.
@Test
public void isSubObjectCodeObjectBad() {
ValidationResult validationResult = concurAccountValidationService.checkSubObjectCode(ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.VALID_ACCT_NBR, ConcurAccountValidationTestConstants.BAD_OBJ_CD, ConcurAccountValidationTestConstants.VALID_SUB_OBJECT);
String subObjectCodeErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.SUB_OBJECT_CODE, ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.VALID_ACCT_NBR, ConcurAccountValidationTestConstants.BAD_OBJ_CD, ConcurAccountValidationTestConstants.VALID_SUB_OBJECT);
Assert.assertFalse("Validation was expected to fail but returned true", validationResult.isValid());
Assert.assertEquals("Error message was expected for bad sub object", MessageFormat.format(concurAccountValidationService.getConfigurationService().getPropertyValueAsString(KFSKeyConstants.ERROR_EXISTENCE), subObjectCodeErrorMessageString) + KFSConstants.NEWLINE, validationResult.getErrorMessagesAsOneFormattedString());
}
Aggregations