use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurAccountValidationServiceTest method isProjectCodeInactive.
@Test
public void isProjectCodeInactive() {
ValidationResult validationResult = concurAccountValidationService.checkProjectCode(ConcurAccountValidationTestConstants.INACTIVE_PROJECT_CODE);
String projectCodeErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.PROJECT_CODE, ConcurAccountValidationTestConstants.INACTIVE_PROJECT_CODE);
Assert.assertFalse("Validation was expected to fail but returned true", validationResult.isValid());
Assert.assertEquals("Error message was expected for inactive project code", MessageFormat.format(concurAccountValidationService.getConfigurationService().getPropertyValueAsString(KFSKeyConstants.ERROR_INACTIVE), projectCodeErrorMessageString) + KFSConstants.NEWLINE, validationResult.getErrorMessagesAsOneFormattedString());
}
use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurAccountValidationServiceTest method isAccountingStringObjectCodeInactive.
@Test
public void isAccountingStringObjectCodeInactive() {
concurAccountInfo.setObjectCode(ConcurAccountValidationTestConstants.INACTIVE_OBJ_CD);
String objectCodeErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.OBJECT_CODE, ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.INACTIVE_OBJ_CD);
String subObjectCodeErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.SUB_OBJECT_CODE, ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.VALID_ACCT_NBR, ConcurAccountValidationTestConstants.INACTIVE_OBJ_CD, ConcurAccountValidationTestConstants.VALID_SUB_OBJECT);
ValidationResult validationResult = concurAccountValidationService.validateConcurAccountInfo(concurAccountInfo);
Assert.assertFalse("Validation was expected to fail but returned true", validationResult.isValid());
Assert.assertEquals("Error messages expected for inactive object code", MessageFormat.format(concurAccountValidationService.getConfigurationService().getPropertyValueAsString(KFSKeyConstants.ERROR_INACTIVE), objectCodeErrorMessageString) + KFSConstants.NEWLINE + MessageFormat.format(concurAccountValidationService.getConfigurationService().getPropertyValueAsString(KFSKeyConstants.ERROR_EXISTENCE), subObjectCodeErrorMessageString) + KFSConstants.NEWLINE, validationResult.getErrorMessagesAsOneFormattedString());
}
use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurAccountValidationServiceTest method isProjectCodeBad.
@Test
public void isProjectCodeBad() {
ValidationResult validationResult = concurAccountValidationService.checkProjectCode(ConcurAccountValidationTestConstants.BAD_PROJECT_CODE);
String projectCodeErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.PROJECT_CODE, ConcurAccountValidationTestConstants.BAD_PROJECT_CODE);
Assert.assertFalse("Validation was expected to fail but returned true", validationResult.isValid());
Assert.assertEquals("Error message was expected for bad project code", MessageFormat.format(concurAccountValidationService.getConfigurationService().getPropertyValueAsString(KFSKeyConstants.ERROR_EXISTENCE), projectCodeErrorMessageString) + KFSConstants.NEWLINE, validationResult.getErrorMessagesAsOneFormattedString());
}
use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.
the class ConcurAccountValidationServiceTest method isAccountInactive.
@Test
public void isAccountInactive() {
ValidationResult validationResult = concurAccountValidationService.checkAccount(ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.INACTIVE_ACCT_NBR);
String accountErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.ACCOUNT_NUMBER, ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.INACTIVE_ACCT_NBR);
Assert.assertFalse("Validation was expected to fail but returned true", validationResult.isValid());
Assert.assertEquals("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 isAccountingStringSubObjectCodeInactive.
@Test
public void isAccountingStringSubObjectCodeInactive() {
concurAccountInfo.setSubObjectCode(ConcurAccountValidationTestConstants.INACTIVE_SUB_OBJECT);
ValidationResult validationResult = concurAccountValidationService.validateConcurAccountInfo(concurAccountInfo);
String subObjectCodeErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.SUB_OBJECT_CODE, ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.VALID_ACCT_NBR, ConcurAccountValidationTestConstants.VALID_OBJ_CD, ConcurAccountValidationTestConstants.INACTIVE_SUB_OBJECT);
Assert.assertFalse("Validation was expected to fail but returned true", validationResult.isValid());
Assert.assertEquals("Error messages expected for inactive sub object code", MessageFormat.format(concurAccountValidationService.getConfigurationService().getPropertyValueAsString(KFSKeyConstants.ERROR_INACTIVE), subObjectCodeErrorMessageString) + KFSConstants.NEWLINE, validationResult.getErrorMessagesAsOneFormattedString());
}
Aggregations