Search in sources :

Example 21 with ValidationResult

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());
}
Also used : ValidationResult(edu.cornell.kfs.concur.businessobjects.ValidationResult) Test(org.junit.Test)

Example 22 with ValidationResult

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());
}
Also used : ValidationResult(edu.cornell.kfs.concur.businessobjects.ValidationResult) Test(org.junit.Test)

Example 23 with ValidationResult

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());
}
Also used : ValidationResult(edu.cornell.kfs.concur.businessobjects.ValidationResult) Test(org.junit.Test)

Example 24 with ValidationResult

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());
}
Also used : ValidationResult(edu.cornell.kfs.concur.businessobjects.ValidationResult) Test(org.junit.Test)

Example 25 with ValidationResult

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());
}
Also used : ValidationResult(edu.cornell.kfs.concur.businessobjects.ValidationResult) Test(org.junit.Test)

Aggregations

ValidationResult (edu.cornell.kfs.concur.businessobjects.ValidationResult)52 Test (org.junit.Test)40 ConcurAccountInfo (edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)3 ConcurBatchReportLineValidationErrorItem (edu.cornell.kfs.concur.batch.report.ConcurBatchReportLineValidationErrorItem)2 ConcurReport (edu.cornell.kfs.concur.businessobjects.ConcurReport)1 ProjectCode (org.kuali.kfs.coa.businessobject.ProjectCode)1 SubAccount (org.kuali.kfs.coa.businessobject.SubAccount)1 SubObjectCode (org.kuali.kfs.coa.businessobject.SubObjectCode)1