Skip to content

Commit

Permalink
[Automated] Merged master into target k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
va-vsp-bot authored Apr 15, 2024
2 parents 9a3086b + bbfcc31 commit a52b115
Show file tree
Hide file tree
Showing 4 changed files with 290 additions and 1 deletion.
17 changes: 17 additions & 0 deletions modules/claims_api/lib/bgs_service/vnp_ptcpnt_addrs_service.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

module ClaimsApi
class VnpPtcpntAddrsService < ClaimsApi::LocalBGS
def vnp_ptcpnt_addrs_create(options)
arg_strg = convert_nil_values(options)
body = Nokogiri::XML::DocumentFragment.parse <<~EOXML
<arg0>
#{arg_strg}
</arg0>
EOXML

make_request(endpoint: 'VnpPtcpntAddrsWebServiceBean/VnpPtcpntAddrsService',
action: 'vnpPtcpntAddrsCreate', body:, key: 'return')
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# frozen_string_literal: true

require 'rails_helper'
require 'bgs_service/vnp_ptcpnt_addrs_service'
require Rails.root.join('modules', 'claims_api', 'spec', 'support', 'bgs_client_helpers.rb')

metadata = {
bgs: {
service: 'vnp_ptcpnt_addrs_service',
operation: 'vnp_ptcpnt_addrs_create'
}
}

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

describe 'vnp_ptcpnt_addrs_create' do
let(:options) { {} }

it 'responds with attributes' do
options[:vnp_ptcpnt_addrs_id] = nil
options[:vnp_proc_id] = '3854596'
options[:vnp_ptcpnt_id] = '182057'
options[:efctv_dt] = '2020-07-16T18:20:18Z'
options[:addrs_one_txt] = '76 Crowther Ave'
options[:addrs_three_txt] = nil
options[:addrs_two_txt] = nil
options[:bad_addrs_ind] = nil
options[:city_nm] = 'Bridgeport'
options[:cntry_nm] = nil
options[:county_nm] = nil
options[:eft_waiver_type_nm] = nil
options[:email_addrs_txt] = '[email protected]'
options[:end_dt] = nil
options[:fms_addrs_code_txt] = nil
options[:frgn_postal_cd] = nil
options[:group_1_verifd_type_cd] = nil
options[:jrn_dt] = '2020-07-16T18:20:17Z'
options[:jrn_lctn_id] = 281
options[:jrn_obj_id] = 'VAgovAPI'
options[:jrn_status_type_cd] = 'U'
options[:jrn_user_id] = 'VAgovAPI'
options[:lctn_nm] = nil
options[:mlty_postal_type_cd] = nil
options[:mlty_post_office_type_cd] = nil
options[:postal_cd] = 'CT'
options[:prvnc_nm] = 'CT'
options[:ptcpnt_addrs_type_nm] = 'Mailing'
options[:shared_addrs_ind] = 'N'
options[:trsury_addrs_five_txt] = nil
options[:trsury_addrs_four_txt] = nil
options[:trsury_addrs_one_txt] = nil
options[:trsury_addrs_six_txt] = nil
options[:trsury_addrs_three_txt] = nil
options[:trsury_addrs_two_txt] = nil
options[:trsury_seq_nbr] = nil
options[:trtry_nm] = nil
options[:zip_first_suffix_nbr] = nil
options[:zip_prefix_nbr] = '06605'
options[:zip_second_suffix_nbr] = nil

use_bgs_cassette('happy_path') do
response = subject.vnp_ptcpnt_addrs_create(options)
expect(response).to include(
{ vnp_ptcpnt_addrs_id: '143950',
efctv_dt: '2020-07-16T18:20:18Z',
vnp_ptcpnt_id: '182057',
vnp_proc_id: '3854596',
addrs_one_txt: '76 Crowther Ave',
city_nm: 'Bridgeport',
email_addrs_txt: '[email protected]',
jrn_dt: '2020-07-16T18:20:17Z',
jrn_lctn_id: '281',
jrn_obj_id: 'VAgovAPI',
jrn_status_type_cd: 'U',
jrn_user_id: 'VAgovAPI',
postal_cd: 'CT',
prvnc_nm: 'CT',
ptcpnt_addrs_type_nm: 'Mailing',
shared_addrs_ind: 'N',
zip_prefix_nbr: '06605' }
)
end
end
end
end
2 changes: 1 addition & 1 deletion modules/claims_api/spec/support/bgs_client_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module BGSClientHelpers
# Then, HTTP interactions that occur within the block supplied to this method
# will be captured by VCR cassettes that have the following convenient
# properties:
# - They will be nicely organized at `bgs/:service/:operation/:name`
# - They will be nicely organized at `claims_api/bgs/:service/:operation/:name`
# - Cassette matching will be done on canonicalized XML bodies, so
# reformatting cassettes for human readability won't defeat matching
def use_bgs_cassette(name, &)
Expand Down

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

0 comments on commit a52b115

Please sign in to comment.