Search in sources :

Example 11 with ConfigurationService

use of org.kuali.kfs.core.api.config.property.ConfigurationService in project cu-kfs by CU-CommunityApps.

the class CreateAccountingDocumentServiceImplTest method buildMockConfigurationService.

private ConfigurationService buildMockConfigurationService() throws Exception {
    ConfigurationService configurationService = Mockito.mock(ConfigurationService.class);
    Mockito.when(configurationService.getPropertyValueAsString(CuFPTestConstants.TEST_VALIDATION_ERROR_KEY)).thenReturn(CuFPTestConstants.TEST_VALIDATION_ERROR_MESSAGE);
    Mockito.when(configurationService.getPropertyValueAsString(CuFPKeyConstants.ERROR_CREATE_ACCOUNTING_DOCUMENT_ATTACHMENT_DOWNLOAD)).thenReturn(CuFPTestConstants.TEST_ATTACHMENT_DOWNLOAD_FAILURE_MESSAGE);
    Mockito.when(configurationService.getPropertyValueAsString(Mockito.startsWith(CuFPTestConstants.AV_VALIDATION_MESSAGE_KEY_PREFIX))).then(this::buildAuxiliaryVoucherErrorMessage);
    Mockito.when(configurationService.getPropertyValueAsString(CuFPKeyConstants.ERROR_CREATE_ACCOUNTING_DOCUMENT_GENERIC_ERROR)).thenReturn(CuFPTestConstants.GENERIC_ERROR_MESSAGE);
    Mockito.when(configurationService.getPropertyValueAsString(CuFPKeyConstants.ERROR_CREATE_ACCOUNTING_DOCUMENT_GENERIC_NUMERIC_ERROR)).thenReturn(CuFPTestConstants.GENERIC_NUMERIC_ERROR_MESSAGE);
    Mockito.when(configurationService.getPropertyValueAsString(CuFPKeyConstants.ERROR_CREATE_ACCOUNTING_DOCUMENT_XML_ADAPTER_ERROR)).thenReturn(CuFPTestConstants.XML_ADAPTER_ERROR_MESSAGE);
    Mockito.when(configurationService.getPropertyValueAsString(CuFPKeyConstants.VALIDATION_CREATE_ACCOUNTING_DOCUMENT_EXCEPTION_MESSAGE_REGEX)).thenReturn(CuFPTestConstants.EXCEPTION_MESSAGE_REGEX);
    return configurationService;
}
Also used : ConfigurationService(org.kuali.kfs.core.api.config.property.ConfigurationService)

Example 12 with ConfigurationService

use of org.kuali.kfs.core.api.config.property.ConfigurationService in project cu-kfs by CU-CommunityApps.

the class CuAttachmentServiceImplTest method buildMockConfigurationService.

private ConfigurationService buildMockConfigurationService() {
    ConfigurationService mockConfigurationService = Mockito.mock(ConfigurationService.class);
    Mockito.when(mockConfigurationService.getPropertyValueAsString(Mockito.any())).then(this::getConfigurationPropertyAsString);
    return mockConfigurationService;
}
Also used : ConfigurationService(org.kuali.kfs.core.api.config.property.ConfigurationService)

Example 13 with ConfigurationService

use of org.kuali.kfs.core.api.config.property.ConfigurationService in project cu-kfs by CU-CommunityApps.

the class RassMockServiceFactory method buildMockConfigurationService.

public ConfigurationService buildMockConfigurationService() throws Exception {
    ConfigurationService configurationService = Mockito.mock(ConfigurationService.class);
    Mockito.when(configurationService.getPropertyValueAsString(RassKeyConstants.MESSAGE_RASS_DOCUMENT_DESCRIPTION)).thenReturn(RassTestConstants.ResourcePropertyValues.MESSAGE_RASS_DOCUMENT_DESCRIPTION);
    Mockito.when(configurationService.getPropertyValueAsString(RassKeyConstants.MESSAGE_RASS_DOCUMENT_ANNOTATION_ROUTE)).thenReturn(RassTestConstants.ResourcePropertyValues.MESSAGE_RASS_DOCUMENT_ANNOTATION_ROUTE);
    Mockito.when(configurationService.getPropertyValueAsString(RassKeyConstants.MESSAGE_RASS_REPORT_ERROR_HEADER_LINE1)).thenReturn(RassTestConstants.ResourcePropertyValues.MESSAGE_RASS_REPORT_ERROR_HEADER_LINE1);
    Mockito.when(configurationService.getPropertyValueAsString(RassKeyConstants.MESSAGE_RASS_REPORT_ERROR_HEADER_LINE2)).thenReturn(RassTestConstants.ResourcePropertyValues.MESSAGE_RASS_REPORT_ERROR_HEADER_LINE2);
    Mockito.when(configurationService.getPropertyValueAsString(RassKeyConstants.MESSAGE_RASS_REPORT_ERROR_HEADER_LINE3)).thenReturn(RassTestConstants.ResourcePropertyValues.MESSAGE_RASS_REPORT_ERROR_HEADER_LINE3);
    return configurationService;
}
Also used : ConfigurationService(org.kuali.kfs.core.api.config.property.ConfigurationService)

Aggregations

ConfigurationService (org.kuali.kfs.core.api.config.property.ConfigurationService)13 DateTimeService (org.kuali.kfs.core.api.datetime.DateTimeService)3 Date (java.sql.Date)2 ParseException (java.text.ParseException)2 CuDisbursementVoucherDefaultDueDateService (edu.cornell.kfs.fp.document.service.CuDisbursementVoucherDefaultDueDateService)1 CreateDoneBatchFile (edu.cornell.kfs.sys.batch.CreateDoneBatchFile)1 File (java.io.File)1 IOException (java.io.IOException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Pair (org.apache.commons.lang3.tuple.Pair)1 ActionForward (org.apache.struts.action.ActionForward)1 Before (org.junit.Before)1 ParameterService (org.kuali.kfs.coreservice.framework.parameter.ParameterService)1 ActionTaken (org.kuali.kfs.kew.actiontaken.ActionTaken)1 UserOptions (org.kuali.kfs.kew.useroptions.UserOptions)1 BatchFile (org.kuali.kfs.sys.batch.BatchFile)1 BatchInputFileServiceImpl (org.kuali.kfs.sys.batch.service.impl.BatchInputFileServiceImpl)1