2
0

Add delivery failure handling to FASP jobs (#35723)

This commit is contained in:
David Roetzel
2025-08-08 11:46:09 +02:00
committed by GitHub
parent 1fd147bf2b
commit 868c46bc76
18 changed files with 373 additions and 106 deletions

View File

@@ -5,13 +5,17 @@ require 'rails_helper'
RSpec.describe Fasp::BackfillWorker do
include ProviderRequestHelper
subject { described_class.new.perform(backfill_request.id) }
let(:backfill_request) { Fabricate(:fasp_backfill_request) }
let(:provider) { backfill_request.fasp_provider }
let(:status) { Fabricate(:status) }
let(:path) { '/data_sharing/v0/announcements' }
let!(:stubbed_request) do
stub_provider_request(provider,
method: :post,
path: '/data_sharing/v0/announcements',
path:,
response_body: {
source: {
backfillRequest: {
@@ -25,8 +29,16 @@ RSpec.describe Fasp::BackfillWorker do
end
it 'sends status uri to provider that requested backfill' do
described_class.new.perform(backfill_request.id)
subject
expect(stubbed_request).to have_been_made
end
describe 'provider delivery failure handling' do
let(:base_stubbed_request) do
stub_request(:post, provider.url(path))
end
it_behaves_like('worker handling fasp delivery failures')
end
end