dor-workflow-client 3.21.0 → 3.22.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 906e80e65d5472f448be536ba072ad4bcf1f3c8e626571ca4a8afc0261eded96
|
4
|
+
data.tar.gz: e0bce8bb182c03ad0da4ceb174d98f8a265a56099c0ad171d9fd9d4d81614ac8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82d97ffa31566dedc9d1c63b729751b83b0b0bc0212fd3e619dce05fa01d0ee285480984db1dabe0c49087e062a07e26603d2d59bbaa788972f7b8d9456b82f6
|
7
|
+
data.tar.gz: 382673d588f6b67e46bb3610d12d48cc51fd076872835d3326693705106fa18f67d1e8360593da7548330105249520eb7f02bc7e634a2ea8cadc18a2781d46e1
|
@@ -278,9 +278,16 @@ module Dor
|
|
278
278
|
# @param [String] repo The repository the object resides in. The service recoginzes "dor" and "sdr" at the moment
|
279
279
|
# @param [String] druid The id of the object to delete the workflow from
|
280
280
|
# @param [String] workflow The name of the workflow to be deleted
|
281
|
+
# @param [Integer] version The version of the workflow to delete
|
281
282
|
# @return [Boolean] always true
|
282
|
-
def delete_workflow(repo, druid, workflow)
|
283
|
-
|
283
|
+
def delete_workflow(repo, druid, workflow, version: nil)
|
284
|
+
qs_args = if version
|
285
|
+
"?version=#{version}"
|
286
|
+
else
|
287
|
+
Deprecation.warn(self, 'Calling delete_workflow without passing version is deprecated and will result in an error in dor-workflow-client 4.0')
|
288
|
+
''
|
289
|
+
end
|
290
|
+
requestor.request "#{repo}/objects/#{druid}/workflows/#{workflow}#{qs_args}", 'delete'
|
284
291
|
true
|
285
292
|
end
|
286
293
|
|
@@ -723,17 +723,29 @@ RSpec.describe Dor::Workflow::Client do
|
|
723
723
|
end
|
724
724
|
|
725
725
|
describe '#delete_workflow' do
|
726
|
-
let(:url) { "/objects/#{@druid}/workflows/accessionWF" }
|
727
|
-
|
728
726
|
let(:stubs) do
|
729
727
|
Faraday::Adapter::Test::Stubs.new do |stub|
|
730
728
|
stub.delete(url) { |_env| [202, {}, ''] }
|
731
729
|
end
|
732
730
|
end
|
733
731
|
|
734
|
-
|
735
|
-
|
736
|
-
|
732
|
+
context 'without a version' do
|
733
|
+
let(:url) { "/objects/#{@druid}/workflows/accessionWF" }
|
734
|
+
|
735
|
+
it 'sends a delete request to the workflow service' do
|
736
|
+
expect(Deprecation).to receive(:warn)
|
737
|
+
expect(mock_http_connection).to receive(:delete).with(url).and_call_original
|
738
|
+
client.delete_workflow(nil, @druid, 'accessionWF')
|
739
|
+
end
|
740
|
+
end
|
741
|
+
|
742
|
+
context 'with a version' do
|
743
|
+
let(:url) { "/objects/#{@druid}/workflows/accessionWF?version=5" }
|
744
|
+
|
745
|
+
it 'sends a delete request to the workflow service' do
|
746
|
+
expect(mock_http_connection).to receive(:delete).with(url).and_call_original
|
747
|
+
client.delete_workflow(nil, @druid, 'accessionWF', version: 5)
|
748
|
+
end
|
737
749
|
end
|
738
750
|
end
|
739
751
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-workflow-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willy Mene
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-05-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
256
|
- !ruby/object:Gem::Version
|
257
257
|
version: '0'
|
258
258
|
requirements: []
|
259
|
-
rubygems_version: 3.
|
259
|
+
rubygems_version: 3.0.3
|
260
260
|
signing_key:
|
261
261
|
specification_version: 4
|
262
262
|
summary: Provides convenience methods to work with the DOR Workflow Service
|