Search in sources :

Example 16 with ValidationResult

use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.

the class ConcurAccountValidationServiceTest method isAccountingStringProjectCodeInactive.

@Test
public void isAccountingStringProjectCodeInactive() {
    concurAccountInfo.setProjectCode(ConcurAccountValidationTestConstants.INACTIVE_PROJECT_CODE);
    ValidationResult validationResult = concurAccountValidationService.validateConcurAccountInfo(concurAccountInfo);
    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 messages expected for bad 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 17 with ValidationResult

use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.

the class ConcurAccountValidationServiceTest method isAccountInfoValid.

@Test
public void isAccountInfoValid() {
    ValidationResult validationResult = concurAccountValidationService.validateConcurAccountInfo(concurAccountInfo);
    Assert.assertTrue(validationResult.getErrorMessagesAsOneFormattedString(), validationResult.isValid());
}
Also used : ValidationResult(edu.cornell.kfs.concur.businessobjects.ValidationResult) Test(org.junit.Test)

Example 18 with ValidationResult

use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.

the class ConcurAccountValidationServiceTest method isObjectCodeNull.

@Test
public void isObjectCodeNull() {
    ValidationResult validationResult = concurAccountValidationService.checkObjectCode(ConcurAccountValidationTestConstants.VALID_CHART, null);
    String objectCodeErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.OBJECT_CODE, ConcurAccountValidationTestConstants.VALID_CHART, null);
    Assert.assertFalse("Validation was expected to fail but returned true", validationResult.isValid());
    Assert.assertEquals("Error message was expected for null object code", MessageFormat.format(concurAccountValidationService.getConfigurationService().getPropertyValueAsString(KFSKeyConstants.ERROR_EXISTENCE), objectCodeErrorMessageString) + KFSConstants.NEWLINE, validationResult.getErrorMessagesAsOneFormattedString());
}
Also used : ValidationResult(edu.cornell.kfs.concur.businessobjects.ValidationResult) Test(org.junit.Test)

Example 19 with ValidationResult

use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.

the class ConcurAccountValidationServiceTest method isProjectCodeValid.

@Test
public void isProjectCodeValid() {
    ValidationResult validationResult = concurAccountValidationService.checkProjectCode(ConcurAccountValidationTestConstants.VALID_PROJECT_CODE);
    Assert.assertTrue("Validation was expected to pass", validationResult.isValid());
    Assert.assertEquals("No error messages expected", 0, validationResult.getMessages().size());
}
Also used : ValidationResult(edu.cornell.kfs.concur.businessobjects.ValidationResult) Test(org.junit.Test)

Example 20 with ValidationResult

use of edu.cornell.kfs.concur.businessobjects.ValidationResult in project cu-kfs by CU-CommunityApps.

the class ConcurAccountValidationServiceTest method isSubObjectCodeValid.

@Test
public void isSubObjectCodeValid() {
    ValidationResult validationResult = concurAccountValidationService.checkSubObjectCode(ConcurAccountValidationTestConstants.VALID_CHART, ConcurAccountValidationTestConstants.VALID_ACCT_NBR, ConcurAccountValidationTestConstants.VALID_OBJ_CD, ConcurAccountValidationTestConstants.VALID_SUB_OBJECT);
    Assert.assertTrue("Validation was expected to pass", validationResult.isValid());
    Assert.assertEquals("No error messages expected", 0, validationResult.getMessages().size());
}
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