Skip to content

Commit

Permalink
add vnp_proc_create to bgs local (#16057)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvcAdHoc authored Mar 28, 2024
1 parent 3666035 commit b190966
Show file tree
Hide file tree
Showing 3 changed files with 283 additions and 0 deletions.
19 changes: 19 additions & 0 deletions modules/claims_api/lib/bgs_service/vnp_proc_service_v2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

module ClaimsApi
class VnpProcServiceV2 < ClaimsApi::LocalBGS
PROC_TYPE_CD = 'POAAUTHZ'

def vnp_proc_create
body = Nokogiri::XML::DocumentFragment.parse <<~EOXML
<arg0>
<VnpProcDTO>
<vnpProcTypeCd>#{PROC_TYPE_CD}</vnpProcTypeCd>
</VnpProcDTO>
</arg0>
EOXML

make_request(endpoint: 'VnpProcWebServiceBeanV2/VnpProcServiceV2', action: 'vnpProcCreate', body:, key: 'return')
end
end
end
17 changes: 17 additions & 0 deletions modules/claims_api/spec/lib/claims_api/vnp_proc_service_v2_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

require 'rails_helper'
require 'bgs_service/vnp_proc_service_v2'

describe ClaimsApi::VnpProcServiceV2 do
subject { described_class.new external_uid: 'xUid', external_key: 'xKey' }

describe 'vnp_proc_create' do
it 'responds with a vnp_proc_id' do
VCR.use_cassette('bgs/vnp_proc_service_v2/vnp_proc_create') do
result = subject.vnp_proc_create
expect(result[:vnp_proc_id]).to eq '29637'
end
end
end
end
247 changes: 247 additions & 0 deletions spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_create.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b190966

Please sign in to comment.