public SpecificationPublishingService(
            ISpecificationIdServiceRequestValidator specificationIdValidator,
            IPublishedProviderIdsServiceRequestValidator publishedProviderIdsValidator,
            IProviderService providerService,
            ISpecificationsApiClient specifications,
            IPublishingResiliencePolicies resiliencePolicies,
            ICacheProvider cacheProvider,
            ICreateRefreshFundingJobs refreshFundingJobs,
            ICreateApproveAllFundingJobs approveSpecificationFundingJobs,
            ICreateApproveBatchFundingJobs approveProviderFundingJobs,
            ISpecificationFundingStatusService specificationFundingStatusService,
            IFundingConfigurationService fundingConfigurationService,
            IPrerequisiteCheckerLocator prerequisiteCheckerLocator,
            IPublishedFundingRepository publishedFundingRepository)
            : base(specificationIdValidator, publishedProviderIdsValidator, specifications, resiliencePolicies, fundingConfigurationService)
        {
            Guard.ArgumentNotNull(refreshFundingJobs, nameof(refreshFundingJobs));
            Guard.ArgumentNotNull(approveSpecificationFundingJobs, nameof(approveSpecificationFundingJobs));
            Guard.ArgumentNotNull(approveProviderFundingJobs, nameof(approveProviderFundingJobs));
            Guard.ArgumentNotNull(cacheProvider, nameof(cacheProvider));
            Guard.ArgumentNotNull(specificationFundingStatusService, nameof(specificationFundingStatusService));
            Guard.ArgumentNotNull(prerequisiteCheckerLocator, nameof(prerequisiteCheckerLocator));
            Guard.ArgumentNotNull(providerService, nameof(providerService));
            Guard.ArgumentNotNull(publishedFundingRepository, nameof(publishedFundingRepository));
            Guard.ArgumentNotNull(resiliencePolicies?.PublishedFundingRepository, "resiliencePolicies.PublishedFundingRepository");

            _refreshFundingJobs = refreshFundingJobs;
            _cacheProvider      = cacheProvider;
            _approveSpecificationFundingJobs   = approveSpecificationFundingJobs;
            _approveProviderFundingJobs        = approveProviderFundingJobs;
            _specificationFundingStatusService = specificationFundingStatusService;
            _prerequisiteCheckerLocator        = prerequisiteCheckerLocator;
            _publishedFundingRepository        = publishedFundingRepository;
            _providerService = providerService;
        }
        public void SetUp()
        {
            _specificationId  = NewRandomString();
            _validationResult = new ValidationResult();

            _validator = Substitute.For <ISpecificationIdServiceRequestValidator>();
            _validator.Validate(_specificationId)
            .Returns(_validationResult);

            _specificationService       = Substitute.For <ISpecificationService>();
            _publishedFundingRepository = Substitute.For <IPublishedFundingRepository>();
            _fundingCountProcessor      = Substitute.For <IPublishedProviderFundingCountProcessor>();
            _fundingCsvDataProcessor    = Substitute.For <IPublishedProviderFundingCsvDataProcessor>();
            _csvUtils   = Substitute.For <ICsvUtils>();
            _blobClient = Substitute.For <IBlobClient>();

            _service = new PublishedProviderStatusService(_validator, _specificationService, _publishedFundingRepository, new ResiliencePolicies
            {
                PublishedFundingRepository     = Polly.Policy.NoOpAsync(),
                SpecificationsRepositoryPolicy = Polly.Policy.NoOpAsync(),
                BlobClient = Polly.Policy.NoOpAsync()
            },
                                                          _fundingCountProcessor,
                                                          _fundingCsvDataProcessor,
                                                          _csvUtils,
                                                          _blobClient);
        }
Пример #3
0
        public PublishedProviderStatusService(
            ISpecificationIdServiceRequestValidator validator,
            ISpecificationService specificationService,
            IPublishedFundingRepository publishedFundingRepository,
            IPublishingResiliencePolicies publishingResiliencePolicies,
            IPublishedProviderFundingCountProcessor fundingCountProcessor,
            IPublishedProviderFundingCsvDataProcessor fundingCsvDataProcessor,
            ICsvUtils csvUtils,
            IBlobClient blobClient)
        {
            Guard.ArgumentNotNull(validator, nameof(validator));
            Guard.ArgumentNotNull(specificationService, nameof(specificationService));
            Guard.ArgumentNotNull(publishedFundingRepository, nameof(publishedFundingRepository));
            Guard.ArgumentNotNull(publishingResiliencePolicies, nameof(publishingResiliencePolicies));
            Guard.ArgumentNotNull(publishingResiliencePolicies.PublishedFundingRepository, nameof(publishingResiliencePolicies.PublishedFundingRepository));
            Guard.ArgumentNotNull(publishingResiliencePolicies.SpecificationsRepositoryPolicy, nameof(publishingResiliencePolicies.SpecificationsRepositoryPolicy));
            Guard.ArgumentNotNull(publishingResiliencePolicies.BlobClient, nameof(publishingResiliencePolicies.BlobClient));
            Guard.ArgumentNotNull(fundingCountProcessor, nameof(fundingCountProcessor));
            Guard.ArgumentNotNull(fundingCsvDataProcessor, nameof(fundingCsvDataProcessor));
            Guard.ArgumentNotNull(csvUtils, nameof(csvUtils));
            Guard.ArgumentNotNull(blobClient, nameof(blobClient));

            _validator                            = validator;
            _specificationService                 = specificationService;
            _publishedFundingRepository           = publishedFundingRepository;
            _fundingCountProcessor                = fundingCountProcessor;
            _publishedFundingRepositoryResilience = publishingResiliencePolicies.PublishedFundingRepository;
            _specificationsRepositoryPolicy       = publishingResiliencePolicies.SpecificationsRepositoryPolicy;
            _blobClientPolicy                     = publishingResiliencePolicies.BlobClient;
            _fundingCsvDataProcessor              = fundingCsvDataProcessor;
            _csvUtils   = csvUtils;
            _blobClient = blobClient;
        }
        public PublishedProviderFundingService(IPublishingResiliencePolicies resiliencePolicies,
                                               IPublishedFundingDataService publishedFunding,
                                               ISpecificationService specificationService,
                                               ISpecificationIdServiceRequestValidator validator)
        {
            Guard.ArgumentNotNull(resiliencePolicies?.PublishedFundingRepository,
                                  nameof(resiliencePolicies.PublishedFundingRepository));
            Guard.ArgumentNotNull(publishedFunding, nameof(publishedFunding));
            Guard.ArgumentNotNull(specificationService, nameof(specificationService));
            Guard.ArgumentNotNull(validator, nameof(validator));

            _resiliencePolicy     = resiliencePolicies.PublishedFundingRepository;
            _publishedFunding     = publishedFunding;
            _specificationService = specificationService;
            _validator            = validator;
        }
Пример #5
0
        protected SpecificationPublishingBase(
            ISpecificationIdServiceRequestValidator specificationIdValidator,
            IPublishedProviderIdsServiceRequestValidator publishedProviderIdsValidator,
            ISpecificationsApiClient specifications,
            IPublishingResiliencePolicies resiliencePolicies,
            IFundingConfigurationService fundingConfigurationService)
        {
            Guard.ArgumentNotNull(specificationIdValidator, nameof(specificationIdValidator));
            Guard.ArgumentNotNull(publishedProviderIdsValidator, nameof(publishedProviderIdsValidator));
            Guard.ArgumentNotNull(specifications, nameof(specifications));
            Guard.ArgumentNotNull(resiliencePolicies?.SpecificationsRepositoryPolicy, nameof(resiliencePolicies.SpecificationsRepositoryPolicy));
            Guard.ArgumentNotNull(fundingConfigurationService, nameof(fundingConfigurationService));

            SpecificationIdValidator      = specificationIdValidator;
            PublishedProviderIdsValidator = publishedProviderIdsValidator;
            Specifications               = specifications;
            _resiliencePolicies          = resiliencePolicies;
            _fundingConfigurationService = fundingConfigurationService;
        }
Пример #6
0
        public ProviderFundingPublishingService(
            ISpecificationIdServiceRequestValidator specificationIdValidator,
            IPublishedProviderIdsServiceRequestValidator publishedProviderIdsValidator,
            ISpecificationsApiClient specifications,
            IPublishingResiliencePolicies resiliencePolicies,
            ICreateAllPublishProviderFundingJobs createAllPublishProviderFundingJobs,
            ICreateBatchPublishProviderFundingJobs createBatchPublishProviderFundingJobs,
            IPublishedFundingRepository publishedFundingRepository,
            IFundingConfigurationService fundingConfigurationService,
            ICreatePublishIntegrityJob createPublishIntegrityJob) :
            base(specificationIdValidator, publishedProviderIdsValidator, specifications, resiliencePolicies, fundingConfigurationService)
        {
            Guard.ArgumentNotNull(createAllPublishProviderFundingJobs, nameof(createAllPublishProviderFundingJobs));
            Guard.ArgumentNotNull(createBatchPublishProviderFundingJobs, nameof(createBatchPublishProviderFundingJobs));
            Guard.ArgumentNotNull(publishedFundingRepository, nameof(publishedFundingRepository));
            Guard.ArgumentNotNull(createPublishIntegrityJob, nameof(createPublishIntegrityJob));

            _createAllPublishProviderFundingJobs   = createAllPublishProviderFundingJobs;
            _createBatchPublishProviderFundingJobs = createBatchPublishProviderFundingJobs;
            _publishedFundingRepository            = publishedFundingRepository;
            _createPublishIntegrityJob             = createPublishIntegrityJob;
        }
        public void SetUp()
        {
            _specificationId  = NewRandomString();
            _validationResult = new ValidationResult();
            _fundingPeriodId  = NewRandomString();
            _fundingStreamId  = NewRandomString();

            _validator = Substitute.For <ISpecificationIdServiceRequestValidator>();
            _validator.Validate(_specificationId)
            .Returns(_validationResult);

            _publishedFunding     = Substitute.For <IPublishedFundingDataService>();
            _specificationService = Substitute.For <ISpecificationService>();

            _service = new PublishedProviderFundingService(new ResiliencePolicies
            {
                PublishedFundingRepository = Polly.Policy.NoOpAsync()
            },
                                                           _publishedFunding,
                                                           _specificationService,
                                                           _validator);
        }