Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
Have Dor.configure initialize the Dor::WorkflowService singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Mar 3, 2016
1 parent 5cd2d39 commit 6bf714d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/dor/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ def configure(*args)
ensure
$-v = temp_v
end

# Initialize and configure the global Dor::WorkflowService for clients that
# do not yet explicitly initialize their workflow connection and/or expect
# dor-services to handle that for them.
#
# TODO: Remove this in dor-services 6.x and/or dor-workflow-service 3.x
result.workflow.client

result
end

Expand Down Expand Up @@ -52,6 +60,10 @@ def make_solr_connection(add_opts = {})
::RSolr::Ext.connect(opts)
end

def make_workflow_service(opts)

end

set_callback :initialize, :after do |config|
config.deep_merge!({
:fedora => {
Expand Down
8 changes: 8 additions & 0 deletions spec/dor/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
end

it 'configures the Dor::WorkflowService when Dor::Config.configure is called' do
expect(Dor::WorkflowService).to receive(:configure).with('http://mynewurl.edu/workflow', kind_of(Hash))

@config.configure do
workflow.url 'http://mynewurl.edu/workflow'
end
end

it 'provides an accessor to the Dor::WorkflowService' do
@config.configure do
workflow.url 'http://mynewurl.edu/workflow'
end
Expand Down

0 comments on commit 6bf714d

Please sign in to comment.