Skip to content

Commit 8fea567

Browse files
committed
Remove legacy kwargs
1 parent 8122300 commit 8fea567

File tree

2 files changed

+1
-39
lines changed

2 files changed

+1
-39
lines changed

app/jobs/journaled/delivery_job.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ class DeliveryJob < ApplicationJob
1414
raise KinesisTemporaryFailure
1515
end
1616

17-
def perform(*events, **legacy_kwargs)
18-
events << legacy_kwargs if legacy_kwargs.present?
17+
def perform(*events)
1918
@kinesis_records = events.map { |e| KinesisRecord.new(**e.delete_if { |_k, v| v.nil? }) }
2019

2120
journal! if Journaled.enabled?

spec/jobs/journaled/delivery_job_spec.rb

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -88,43 +88,6 @@
8888
end
8989
end
9090

91-
unless Gem::Version.new(Journaled::VERSION) < Gem::Version.new('6.0.0')
92-
raise <<~MSG
93-
Hey! I see that you're bumping the version to 6.0!
94-
95-
This is a reminder to:
96-
- Remove the `legacy_kwargs` argument (and related logic) from `Journaled::DeliveryJob`
97-
- Remove the related test context below
98-
99-
Thanks!
100-
MSG
101-
end
102-
103-
context 'when supplying legacy kwargs (a single event) instead of a list of events' do
104-
let(:args) { { serialized_event: '{"foo":"bar"}', partition_key: 'fake_partition_key', stream_name: 'test_events' } }
105-
106-
it 'makes requests to AWS to put the event on the Kinesis with the correct body' do
107-
events = described_class.perform_now(**args)
108-
109-
expect(events.count).to eq 1
110-
expect(events.first.shard_id).to eq '101'
111-
expect(events.first.sequence_number).to eq '101123'
112-
expect(kinesis_client).to have_received(:put_record).with(
113-
stream_name: 'test_events',
114-
data: '{"foo":"bar"}',
115-
partition_key: 'fake_partition_key',
116-
)
117-
end
118-
119-
context 'when the stream name is not set' do
120-
let(:args) { { serialized_event: '{"foo":"bar"}', partition_key: 'fake_partition_key', stream_name: nil } }
121-
122-
it 'raises an ArgumentError' do
123-
expect { described_class.perform_now(**args) }.to raise_error ArgumentError, /missing keyword: :?stream_name/
124-
end
125-
end
126-
end
127-
12891
context 'when Amazon responds with an InternalFailure' do
12992
before do
13093
kinesis_client.stub_responses(:put_record, 'InternalFailure')

0 commit comments

Comments
 (0)