From 0c82c6701a2edac26707b9e1a01a07909e363cb5 Mon Sep 17 00:00:00 2001 From: Oren Mittman Date: Fri, 26 Apr 2024 01:28:19 -0400 Subject: [PATCH] operation -> action in `BGSClientSpecHelpers` for naming consistency --- modules/claims_api/README.md | 2 +- .../create_veteran_representative_request_spec.rb | 2 +- .../read_all_veteran_representatives_spec.rb | 2 +- .../read_poa_request_spec.rb | 2 +- .../update_poa_request_spec.rb | 2 +- .../spec/lib/claims_api/vnp_atchms_service_spec.rb | 2 +- .../spec/lib/claims_api/vnp_person_service_spec.rb | 2 +- .../claims_api/vnp_ptcpnt_addrs_service_spec.rb | 2 +- .../power_of_attorney_requests/index/rswag_spec.rb | 2 +- .../spec/support/bgs_client_spec_helpers.rb | 14 +++++++------- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/claims_api/README.md b/modules/claims_api/README.md index 13dab9b1d3d..14bc40e63d2 100644 --- a/modules/claims_api/README.md +++ b/modules/claims_api/README.md @@ -10,7 +10,7 @@ ssh -L 4447:localhost:4447 {{aws-url}} ssh -L 4431:localhost:4431 {{aws-url}} ## Testing -### Unit testing BGS service operation wrappers +### Unit testing BGS service action wrappers If using cassettes, make sure to only make or use ones under [spec/support/vcr_cassettes/claims_api](spec/support/vcr_cassettes/claims_api) Check out documentation in comments for the spec helper `BGSClientSpecHelpers#use_bgs_cassette` diff --git a/modules/claims_api/spec/lib/claims_api/bgs/veteran_representative_service/create_veteran_representative_request_spec.rb b/modules/claims_api/spec/lib/claims_api/bgs/veteran_representative_service/create_veteran_representative_request_spec.rb index 47f189bdb93..6b4a039e1cf 100644 --- a/modules/claims_api/spec/lib/claims_api/bgs/veteran_representative_service/create_veteran_representative_request_spec.rb +++ b/modules/claims_api/spec/lib/claims_api/bgs/veteran_representative_service/create_veteran_representative_request_spec.rb @@ -7,7 +7,7 @@ metadata = { bgs: { service: 'veteran_representative_service', - operation: 'create_veteran_representative' + action: 'create_veteran_representative' } } diff --git a/modules/claims_api/spec/lib/claims_api/bgs/veteran_representative_service/read_all_veteran_representatives_spec.rb b/modules/claims_api/spec/lib/claims_api/bgs/veteran_representative_service/read_all_veteran_representatives_spec.rb index 285ba000961..4bdcde0fdbf 100644 --- a/modules/claims_api/spec/lib/claims_api/bgs/veteran_representative_service/read_all_veteran_representatives_spec.rb +++ b/modules/claims_api/spec/lib/claims_api/bgs/veteran_representative_service/read_all_veteran_representatives_spec.rb @@ -7,7 +7,7 @@ metadata = { bgs: { service: 'veteran_representative_service', - operation: 'read_all_veteran_representatives' + action: 'read_all_veteran_representatives' }, run_at: '2024-04-17T23:10:31+00:00' } diff --git a/modules/claims_api/spec/lib/claims_api/manage_representative_service/read_poa_request_spec.rb b/modules/claims_api/spec/lib/claims_api/manage_representative_service/read_poa_request_spec.rb index 673c5a61130..af695f4a26c 100644 --- a/modules/claims_api/spec/lib/claims_api/manage_representative_service/read_poa_request_spec.rb +++ b/modules/claims_api/spec/lib/claims_api/manage_representative_service/read_poa_request_spec.rb @@ -7,7 +7,7 @@ metadata = { bgs: { service: 'manage_representative_service', - operation: 'read_poa_request' + action: 'read_poa_request' } } diff --git a/modules/claims_api/spec/lib/claims_api/manage_representative_service/update_poa_request_spec.rb b/modules/claims_api/spec/lib/claims_api/manage_representative_service/update_poa_request_spec.rb index 9fe26fc7315..680e7acf9b9 100644 --- a/modules/claims_api/spec/lib/claims_api/manage_representative_service/update_poa_request_spec.rb +++ b/modules/claims_api/spec/lib/claims_api/manage_representative_service/update_poa_request_spec.rb @@ -7,7 +7,7 @@ metadata = { bgs: { service: 'manage_representative_service', - operation: 'update_poa_request' + action: 'update_poa_request' } } diff --git a/modules/claims_api/spec/lib/claims_api/vnp_atchms_service_spec.rb b/modules/claims_api/spec/lib/claims_api/vnp_atchms_service_spec.rb index 23c929c4410..96e078dbde3 100644 --- a/modules/claims_api/spec/lib/claims_api/vnp_atchms_service_spec.rb +++ b/modules/claims_api/spec/lib/claims_api/vnp_atchms_service_spec.rb @@ -7,7 +7,7 @@ metadata = { bgs: { service: 'vnp_atchms_service', - operation: 'vnp_atchms_create' + action: 'vnp_atchms_create' } } diff --git a/modules/claims_api/spec/lib/claims_api/vnp_person_service_spec.rb b/modules/claims_api/spec/lib/claims_api/vnp_person_service_spec.rb index e02f9a65b71..9cf16770b8c 100644 --- a/modules/claims_api/spec/lib/claims_api/vnp_person_service_spec.rb +++ b/modules/claims_api/spec/lib/claims_api/vnp_person_service_spec.rb @@ -7,7 +7,7 @@ metadata = { bgs: { service: 'vnp_person_service', - operation: 'vnp_person_create' + action: 'vnp_person_create' } } diff --git a/modules/claims_api/spec/lib/claims_api/vnp_ptcpnt_addrs_service_spec.rb b/modules/claims_api/spec/lib/claims_api/vnp_ptcpnt_addrs_service_spec.rb index 2b06ac1defa..7a626a44c3f 100644 --- a/modules/claims_api/spec/lib/claims_api/vnp_ptcpnt_addrs_service_spec.rb +++ b/modules/claims_api/spec/lib/claims_api/vnp_ptcpnt_addrs_service_spec.rb @@ -7,7 +7,7 @@ metadata = { bgs: { service: 'vnp_ptcpnt_addrs_service', - operation: 'vnp_ptcpnt_addrs_create' + action: 'vnp_ptcpnt_addrs_create' } } diff --git a/modules/claims_api/spec/requests/v2/power_of_attorney_requests/index/rswag_spec.rb b/modules/claims_api/spec/requests/v2/power_of_attorney_requests/index/rswag_spec.rb index 693db5b46ea..fa1816989a4 100644 --- a/modules/claims_api/spec/requests/v2/power_of_attorney_requests/index/rswag_spec.rb +++ b/modules/claims_api/spec/requests/v2/power_of_attorney_requests/index/rswag_spec.rb @@ -11,7 +11,7 @@ production: false, bgs: { service: 'manage_representative_service', - operation: 'read_poa_request' + action: 'read_poa_request' } } diff --git a/modules/claims_api/spec/support/bgs_client_spec_helpers.rb b/modules/claims_api/spec/support/bgs_client_spec_helpers.rb index 9c8f4ede8b9..bbe5b931670 100644 --- a/modules/claims_api/spec/support/bgs_client_spec_helpers.rb +++ b/modules/claims_api/spec/support/bgs_client_spec_helpers.rb @@ -26,32 +26,32 @@ module BGSClientSpecHelpers }.freeze # This convenience method affords a handful of quality of life improvements - # for developing BGS service operation wrappers. It makes development a less + # for developing BGS service action wrappers. It makes development a less # manual process. It also turns VCR cassettes into a human readable resource # that documents the behavior of BGS. # # In order to take advantage of this method, you will need to have supplied, # to your example or example group, metadata of this form: - # `{ bgs: { service: "service", operation: "operation" } }`. + # `{ bgs: { service: "service", action: "action" } }`. # # 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 `claims_api/bgs/:service/:operation/:name` + # - They will be nicely organized at `claims_api/bgs/:service/:action/: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, &) metadata = RSpec.current_example.metadata[:bgs].to_h - service, operation = metadata.values_at(:service, :operation) + service, action = metadata.values_at(:service, :action) - if service.blank? || operation.blank? + if service.blank? || action.blank? raise ArgumentError, <<~HEREDOC Must provide spec metadata of the form: - `{ bgs: { service: "service", operation: "operation" } }' + `{ bgs: { service: "service", action: "action" } }' HEREDOC end - name = File.join('claims_api/bgs', service, operation, name) + name = File.join('claims_api/bgs', service, action, name) VCR.use_cassette(name, VCR_OPTIONS, &) end end