From 26b50b74640be83f20d019fc28150a93232fffe9 Mon Sep 17 00:00:00 2001 From: Matt Christianson Date: Tue, 26 Mar 2024 14:33:45 -0400 Subject: [PATCH 1/8] Add new service, add spec & cassette --- .../lib/bgs_service/vnp_proc_form_service.rb | 28 ++ .../claims_api/vnp_proc_form_service_spec.rb | 26 ++ .../vnp_proc_form_service.yml | 298 ++++++++++++++++++ 3 files changed, 352 insertions(+) create mode 100644 modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb create mode 100644 modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb create mode 100644 spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml diff --git a/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb b/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb new file mode 100644 index 00000000000..c47b934d4b5 --- /dev/null +++ b/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module ClaimsApi + class VnpProcFormService < LocalBGS + FORM_TYPE_CD = '21-22' + + def vnp_proc_form_create(options) + body = Nokogiri::XML::DocumentFragment.parse <<~EOXML + + + + #{options[:vnp_proc_id]} + #{FORM_TYPE_CD} + + #{options[:jrn_dt]} + #{options[:vnp_ptcpnt_id]} + #{options[:jrn_obj_id]} + #{options[:jrn_status_type_cd]} + #{options[:jrn_user_id]} + + + EOXML + + make_request(endpoint: 'VnpProcFormWebServiceBean/VnpProcFormService', + action: 'vnpProcFormCreate', body:, key: 'return') + end + end +end \ No newline at end of file diff --git a/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb new file mode 100644 index 00000000000..54462bc05dc --- /dev/null +++ b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require 'rails_helper' +require 'bgs_service/vnp_proc_form_service' + +describe ClaimsApi::VnpProcFormService do + subject { described_class.new external_uid: 'xUid', external_key: 'xKey' } + + describe 'vnp_proc_form_service' do + let(:options) { {} } + + it 'responds with a vnc_proc_id' do + # options[:vnp_proc_id] = '3830252' # '3854437''3830249' # + # options[:vnp_ptcpnt_id] = nil + # options[:jrn_dt] = nil + # options[:jrn_obj_id] = nil + # options[:jrn_status_type_cd] = nil + # options[:jrn_user_id] = nil + VCR.use_cassette('bgs/vnp_proc_service_v2/vnp_proc_form_service') do + byebug + response = subject.vnp_proc_form_create(options) + expect(response[:vnp_proc_id]).to eq '29637' + end + end + end +end \ No newline at end of file diff --git a/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml b/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml new file mode 100644 index 00000000000..4a588d5ec57 --- /dev/null +++ b/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml @@ -0,0 +1,298 @@ +--- +http_interactions: +- request: + method: get + uri: https://localhost:4447/VnpProcFormWebServiceBean/VnpProcFormService?WSDL + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v2.9.0 + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 26 Mar 2024 18:20:34 GMT + Server: + - Apache + X-Frame-Options: + - SAMEORIGIN + Transfer-Encoding: + - chunked + Content-Type: + - text/xml;charset=utf-8 + Strict-Transport-Security: + - max-age=16000000; includeSubDomains; preload; + body: + encoding: UTF-8 + string: |- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + recorded_at: Tue, 26 Mar 2024 18:20:34 GMT +- request: + method: post + uri: https://localhost:4447/VnpProcFormWebServiceBean/VnpProcFormService + body: + encoding: UTF-8 + string: | + + + + + + VAgovAPI + + + 192.168.0.9 + 281 + VAgovAPI + xUid + xKey + + + + + + + + + + + 21-22 + + + + + + + + + + + + + headers: + User-Agent: + - Faraday v2.9.0 + Content-Type: + - text/xml;charset=UTF-8 + Host: + - ".vba.va.gov" + Soapaction: + - '"vnpProcFormCreate"' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 500 + message: Internal Server Error + headers: + Date: + - Tue, 26 Mar 2024 18:20:35 GMT + Server: + - Apache + X-Frame-Options: + - SAMEORIGIN + X-Oracle-Dms-Ecid: + - 2816874f-ef7b-4a50-9f2b-bd3cee82a6db-000bb5a3 + X-Oracle-Dms-Rid: + - '0' + Transfer-Encoding: + - chunked + Content-Type: + - text/xml; charset=utf-8 + Strict-Transport-Security: + - max-age=16000000; includeSubDomains; preload; + body: + encoding: UTF-8 + string: "rO0ABXdKABR3ZWJsb2dpYy5hcHAudm5wLWVhcgAAANYAAAAjd2VibG9naWMud29ya2FyZWEuU3RyaW5nV29ya0NvbnRleHQABTIuMC44AAA=ns0:ServerEJB + Exception: : java.lang.NullPointerException\n\tat gov.va.vba.vonapp.services.procFormService.VnpProcFormWebServiceBean.vnpProcFormCreate(Unknown + Source)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat + sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat + sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat + java.lang.reflect.Method.invoke(Method.java:498)\n\tat com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)\n\tat + com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)\n\tat + com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n\tat + com.oracle.pitchfork.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:101)\n\tat + com.oracle.pitchfork.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:101)\n\tat + com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat + com.oracle.pitchfork.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:101)\n\tat + org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)\n\tat + org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)\n\tat + sun.reflect.GeneratedMethodAccessor30057.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat + java.lang.reflect.Method.invoke(Method.java:498)\n\tat com.oracle.pitchfork.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:94)\n\tat + com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat + com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)\n\tat + com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)\n\tat + com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat + com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)\n\tat + com.sun.proxy.$Proxy2450.vnpProcFormCreate(Unknown Source)\n\tat gov.va.vba.vonapp.services.procFormService.VnpProcFormWebServiceBean_b3ox9c_WSOImpl.__WL_invoke(Unknown + Source)\n\tat weblogic.ejb.container.internal.WSOMethodInvoker.invoke(WSOMethodInvoker.java:24)\n\tat + gov.va.vba.vonapp.services.procFormService.VnpProcFormWebServiceBean_b3ox9c_WSOImpl.__WL_vnpProcFormCreate_WS(Unknown + Source)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat + sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat + sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat + java.lang.reflect.Method.invoke(Method.java:498)\n\tat weblogic.wsee.server.ejb.WsEjb.invoke(WsEjb.java:55)\n\tat + weblogic.wsee.jaxws.WLSEjbInstanceResolver$WLSEjbInvoker.invoke(WLSEjbInstanceResolver.java:196)\n\tat + weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:93)\n\tat + com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:149)\n\tat com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:88)\n\tat + com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)\n\tat com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)\n\tat + com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)\n\tat com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)\n\tat + com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:419)\n\tat + com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:868)\n\tat + com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:422)\n\tat + com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:169)\n\tat + weblogic.wsee.jaxws.WLSServletAdapter.handle(WLSServletAdapter.java:246)\n\tat + weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:667)\n\tat + weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:386)\n\tat + weblogic.security.service.SecurityManager.runAs(SecurityManager.java:163)\n\tat + weblogic.wsee.util.ServerSecurityHelper.authenticatedInvoke(ServerSecurityHelper.java:108)\n\tat + weblogic.wsee.jaxws.HttpServletAdapter$3.run(HttpServletAdapter.java:286)\n\tat + weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:295)\n\tat + weblogic.wsee.jaxws.JAXWSServlet.doRequest(JAXWSServlet.java:128)\n\tat weblogic.servlet.http.AbstractAsyncServlet.service(AbstractAsyncServlet.java:103)\n\tat + javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n\tat weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:295)\n\tat + weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)\n\tat + weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)\n\tat + weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:353)\n\tat + weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:250)\n\tat + weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3796)\n\tat + weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3766)\n\tat + weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:344)\n\tat + weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)\n\tat + weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)\n\tat + weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)\n\tat + weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2454)\n\tat + weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2302)\n\tat + weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2280)\n\tat + weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1739)\n\tat + weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1699)\n\tat + weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)\n\tat + weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)\n\tat + weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)\n\tat + weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)\n\tat + weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)\n\tat + weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:655)\n\tat + weblogic.work.ExecuteThread.execute(ExecuteThread.java:420)\n\tat weblogic.work.ExecuteThread.run(ExecuteThread.java:360)\n" + recorded_at: Tue, 26 Mar 2024 18:20:35 GMT +recorded_with: VCR 6.2.0 From f4a1a4ed71ce8d80907250fbf43269e90dea6c99 Mon Sep 17 00:00:00 2001 From: Matt Christianson Date: Tue, 26 Mar 2024 15:05:42 -0400 Subject: [PATCH 2/8] Add newlines, remove byebug --- modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb | 2 +- .../spec/lib/claims_api/vnp_proc_form_service_spec.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb b/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb index c47b934d4b5..5f27f887627 100644 --- a/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb +++ b/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb @@ -25,4 +25,4 @@ def vnp_proc_form_create(options) action: 'vnpProcFormCreate', body:, key: 'return') end end -end \ No newline at end of file +end diff --git a/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb index 54462bc05dc..36b5a6966ee 100644 --- a/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb +++ b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb @@ -17,10 +17,9 @@ # options[:jrn_status_type_cd] = nil # options[:jrn_user_id] = nil VCR.use_cassette('bgs/vnp_proc_service_v2/vnp_proc_form_service') do - byebug response = subject.vnp_proc_form_create(options) expect(response[:vnp_proc_id]).to eq '29637' end end end -end \ No newline at end of file +end From da355c15b673e7abc6e2ab47a195c95d04f8d11f Mon Sep 17 00:00:00 2001 From: Matt Christianson Date: Wed, 27 Mar 2024 10:19:47 -0400 Subject: [PATCH 3/8] Update procId handling for nil, update test, update cassette --- .../lib/bgs_service/vnp_proc_form_service.rb | 34 +++-- .../claims_api/vnp_proc_form_service_spec.rb | 14 +- .../vnp_proc_form_service.yml | 139 ++++-------------- 3 files changed, 59 insertions(+), 128 deletions(-) diff --git a/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb b/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb index 5f27f887627..ddfd23b833e 100644 --- a/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb +++ b/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb @@ -1,28 +1,36 @@ # frozen_string_literal: true module ClaimsApi - class VnpProcFormService < LocalBGS + class VnpProcFormService < ClaimsApi::LocalBGS FORM_TYPE_CD = '21-22' def vnp_proc_form_create(options) + vnp_proc_id = options[:vnp_proc_id] + options.delete(:vnp_proc_id) + vnp_proc_id = '' if vnp_proc_id.blank? + arg_strg = convert_nil_values(options) body = Nokogiri::XML::DocumentFragment.parse <<~EOXML - - - #{options[:vnp_proc_id]} - #{FORM_TYPE_CD} - - #{options[:jrn_dt]} - #{options[:vnp_ptcpnt_id]} - #{options[:jrn_obj_id]} - #{options[:jrn_status_type_cd]} - #{options[:jrn_user_id]} - - + + #{vnp_proc_id} + #{FORM_TYPE_CD} + + #{arg_strg} EOXML make_request(endpoint: 'VnpProcFormWebServiceBean/VnpProcFormService', action: 'vnpProcFormCreate', body:, key: 'return') end + + private + + def convert_nil_values(options) + arg_strg = '' + options.each do |option| + arg = option[0].to_s.camelize(:lower) + arg_strg += (option[1].nil? ? "<#{arg} xsi:nil=true/>" : "<#{arg}>#{option[1]}") + end + arg_strg += '' + end end end diff --git a/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb index 36b5a6966ee..44a3705e879 100644 --- a/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb +++ b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb @@ -10,15 +10,15 @@ let(:options) { {} } it 'responds with a vnc_proc_id' do - # options[:vnp_proc_id] = '3830252' # '3854437''3830249' # - # options[:vnp_ptcpnt_id] = nil - # options[:jrn_dt] = nil - # options[:jrn_obj_id] = nil - # options[:jrn_status_type_cd] = nil - # options[:jrn_user_id] = nil + options[:vnp_proc_id] = '3830249' #'3830252' '3854437' # + options[:vnp_ptcpnt_id] = nil + options[:jrn_dt] = nil + options[:jrn_obj_id] = 'VAgovAPI' + options[:jrn_status_type_cd] = 'U' + options[:jrn_user_id] = 'VAgovAPI' VCR.use_cassette('bgs/vnp_proc_service_v2/vnp_proc_form_service') do response = subject.vnp_proc_form_create(options) - expect(response[:vnp_proc_id]).to eq '29637' + expect(response[:comp_id][:vnp_proc_id]).to eq '3830249' end end end diff --git a/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml b/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml index 4a588d5ec57..574bf1c8f44 100644 --- a/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml +++ b/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://localhost:4447/VnpProcFormWebServiceBean/VnpProcFormService?WSDL + uri: https://internal-dsva-vagov-dev-fwdproxy-1893365470.us-gov-west-1.elb.amazonaws.com:4447/VnpProcFormWebServiceBean/VnpProcFormService?WSDL body: encoding: US-ASCII string: '' @@ -19,7 +19,7 @@ http_interactions: message: OK headers: Date: - - Tue, 26 Mar 2024 18:20:34 GMT + - Wed, 27 Mar 2024 13:51:27 GMT Server: - Apache X-Frame-Options: @@ -48,12 +48,6 @@ http_interactions: - - - - - - @@ -66,17 +60,18 @@ http_interactions: + + + + + + - - - - - @@ -87,6 +82,11 @@ http_interactions: + + + + + @@ -102,7 +102,7 @@ http_interactions: - + @@ -114,7 +114,7 @@ http_interactions: - + @@ -126,7 +126,7 @@ http_interactions: - + @@ -145,10 +145,10 @@ http_interactions: - recorded_at: Tue, 26 Mar 2024 18:20:34 GMT + recorded_at: Wed, 27 Mar 2024 13:51:27 GMT - request: method: post - uri: https://localhost:4447/VnpProcFormWebServiceBean/VnpProcFormService + uri: https://internal-dsva-vagov-dev-fwdproxy-1893365470.us-gov-west-1.elb.amazonaws.com:4447/VnpProcFormWebServiceBean/VnpProcFormService body: encoding: UTF-8 string: | @@ -172,18 +172,11 @@ http_interactions: - - - - 21-22 - - - - - - - - + + 3830249 + 21-22 + + true/true/VAgovAPIUVAgovAPI @@ -203,19 +196,15 @@ http_interactions: - "*/*" response: status: - code: 500 - message: Internal Server Error + code: 200 + message: OK headers: Date: - - Tue, 26 Mar 2024 18:20:35 GMT + - Wed, 27 Mar 2024 13:51:28 GMT Server: - Apache X-Frame-Options: - SAMEORIGIN - X-Oracle-Dms-Ecid: - - 2816874f-ef7b-4a50-9f2b-bd3cee82a6db-000bb5a3 - X-Oracle-Dms-Rid: - - '0' Transfer-Encoding: - chunked Content-Type: @@ -224,75 +213,9 @@ http_interactions: - max-age=16000000; includeSubDomains; preload; body: encoding: UTF-8 - string: "rO0ABXdKABR3ZWJsb2dpYy5hcHAudm5wLWVhcgAAANYAAAAjd2VibG9naWMud29ya2FyZWEuU3RyaW5nV29ya0NvbnRleHQABTIuMC44AAA=ns0:ServerEJB - Exception: : java.lang.NullPointerException\n\tat gov.va.vba.vonapp.services.procFormService.VnpProcFormWebServiceBean.vnpProcFormCreate(Unknown - Source)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat - sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat - sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat - java.lang.reflect.Method.invoke(Method.java:498)\n\tat com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)\n\tat - com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)\n\tat - com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n\tat - com.oracle.pitchfork.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:101)\n\tat - com.oracle.pitchfork.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:101)\n\tat - com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat - com.oracle.pitchfork.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:101)\n\tat - org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)\n\tat - org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)\n\tat - sun.reflect.GeneratedMethodAccessor30057.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat - java.lang.reflect.Method.invoke(Method.java:498)\n\tat com.oracle.pitchfork.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:94)\n\tat - com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat - com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)\n\tat - com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)\n\tat - com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat - com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)\n\tat - com.sun.proxy.$Proxy2450.vnpProcFormCreate(Unknown Source)\n\tat gov.va.vba.vonapp.services.procFormService.VnpProcFormWebServiceBean_b3ox9c_WSOImpl.__WL_invoke(Unknown - Source)\n\tat weblogic.ejb.container.internal.WSOMethodInvoker.invoke(WSOMethodInvoker.java:24)\n\tat - gov.va.vba.vonapp.services.procFormService.VnpProcFormWebServiceBean_b3ox9c_WSOImpl.__WL_vnpProcFormCreate_WS(Unknown - Source)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat - sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat - sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat - java.lang.reflect.Method.invoke(Method.java:498)\n\tat weblogic.wsee.server.ejb.WsEjb.invoke(WsEjb.java:55)\n\tat - weblogic.wsee.jaxws.WLSEjbInstanceResolver$WLSEjbInvoker.invoke(WLSEjbInstanceResolver.java:196)\n\tat - weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:93)\n\tat - com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:149)\n\tat com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:88)\n\tat - com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)\n\tat com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)\n\tat - com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)\n\tat com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)\n\tat - com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:419)\n\tat - com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:868)\n\tat - com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:422)\n\tat - com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:169)\n\tat - weblogic.wsee.jaxws.WLSServletAdapter.handle(WLSServletAdapter.java:246)\n\tat - weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:667)\n\tat - weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:386)\n\tat - weblogic.security.service.SecurityManager.runAs(SecurityManager.java:163)\n\tat - weblogic.wsee.util.ServerSecurityHelper.authenticatedInvoke(ServerSecurityHelper.java:108)\n\tat - weblogic.wsee.jaxws.HttpServletAdapter$3.run(HttpServletAdapter.java:286)\n\tat - weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:295)\n\tat - weblogic.wsee.jaxws.JAXWSServlet.doRequest(JAXWSServlet.java:128)\n\tat weblogic.servlet.http.AbstractAsyncServlet.service(AbstractAsyncServlet.java:103)\n\tat - javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n\tat weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:295)\n\tat - weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)\n\tat - weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)\n\tat - weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:353)\n\tat - weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:250)\n\tat - weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3796)\n\tat - weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3766)\n\tat - weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:344)\n\tat - weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)\n\tat - weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)\n\tat - weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)\n\tat - weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2454)\n\tat - weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2302)\n\tat - weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2280)\n\tat - weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1739)\n\tat - weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1699)\n\tat - weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)\n\tat - weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)\n\tat - weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)\n\tat - weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)\n\tat - weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)\n\tat - weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:655)\n\tat - weblogic.work.ExecuteThread.execute(ExecuteThread.java:420)\n\tat weblogic.work.ExecuteThread.run(ExecuteThread.java:360)\n" - recorded_at: Tue, 26 Mar 2024 18:20:35 GMT + string: rO0ABXdKABR3ZWJsb2dpYy5hcHAudm5wLWVhcgAAANYAAAAjd2VibG9naWMud29ya2FyZWEuU3RyaW5nV29ya0NvbnRleHQABTIuMC44AAA=383024921-22VAgovAPIUVAgovAPI + recorded_at: Wed, 27 Mar 2024 13:51:29 GMT recorded_with: VCR 6.2.0 From 83b6ee7eab07f923a3a8f63a36e88e875a48f1ed Mon Sep 17 00:00:00 2001 From: Matt Christianson Date: Wed, 27 Mar 2024 10:24:42 -0400 Subject: [PATCH 4/8] Rubocop spacing fix --- .../spec/lib/claims_api/vnp_proc_form_service_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb index 44a3705e879..827a7856c7b 100644 --- a/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb +++ b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb @@ -10,7 +10,7 @@ let(:options) { {} } it 'responds with a vnc_proc_id' do - options[:vnp_proc_id] = '3830249' #'3830252' '3854437' # + options[:vnp_proc_id] = '3830249' # '3830252' '3854437' # options[:vnp_ptcpnt_id] = nil options[:jrn_dt] = nil options[:jrn_obj_id] = 'VAgovAPI' From 25089c9aa268134d5e72f3fb06c34f8f13c479cc Mon Sep 17 00:00:00 2001 From: Matt Christianson Date: Wed, 27 Mar 2024 14:15:39 -0400 Subject: [PATCH 5/8] Move method to base class, minor tweak to service for same --- modules/claims_api/lib/bgs_service/local_bgs.rb | 9 +++++++++ .../lib/bgs_service/vnp_proc_form_service.rb | 12 +----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/modules/claims_api/lib/bgs_service/local_bgs.rb b/modules/claims_api/lib/bgs_service/local_bgs.rb index a86683900b3..20082072be0 100644 --- a/modules/claims_api/lib/bgs_service/local_bgs.rb +++ b/modules/claims_api/lib/bgs_service/local_bgs.rb @@ -339,5 +339,14 @@ def transform_bgs_claims_to_evss(claims) def to_camelcase(claim:) claim.deep_transform_keys { |k| k.to_s.camelize(:lower) } end + + def convert_nil_values(options) + arg_strg = '' + options.each do |option| + arg = option[0].to_s.camelize(:lower) + arg_strg += (option[1].nil? ? "<#{arg} xsi:nil='true'/>" : "<#{arg}>#{option[1]}") + end + arg_strg + end end end diff --git a/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb b/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb index ddfd23b833e..3ae45265876 100644 --- a/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb +++ b/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb @@ -16,21 +16,11 @@ def vnp_proc_form_create(options) #{FORM_TYPE_CD} #{arg_strg} + EOXML make_request(endpoint: 'VnpProcFormWebServiceBean/VnpProcFormService', action: 'vnpProcFormCreate', body:, key: 'return') end - - private - - def convert_nil_values(options) - arg_strg = '' - options.each do |option| - arg = option[0].to_s.camelize(:lower) - arg_strg += (option[1].nil? ? "<#{arg} xsi:nil=true/>" : "<#{arg}>#{option[1]}") - end - arg_strg += '' - end end end From c004e65fb4a3692bb304360eafb371180746c410 Mon Sep 17 00:00:00 2001 From: Matt Christianson Date: Wed, 27 Mar 2024 14:53:29 -0400 Subject: [PATCH 6/8] Update test to use new procId, add updated cassette --- .../claims_api/vnp_proc_form_service_spec.rb | 4 ++-- .../vnp_proc_form_service.yml | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb index 827a7856c7b..4179e88e4ea 100644 --- a/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb +++ b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb @@ -10,7 +10,7 @@ let(:options) { {} } it 'responds with a vnc_proc_id' do - options[:vnp_proc_id] = '3830249' # '3830252' '3854437' # + options[:vnp_proc_id] = '3831394' # '3830252' '3854437' # options[:vnp_ptcpnt_id] = nil options[:jrn_dt] = nil options[:jrn_obj_id] = 'VAgovAPI' @@ -18,7 +18,7 @@ options[:jrn_user_id] = 'VAgovAPI' VCR.use_cassette('bgs/vnp_proc_service_v2/vnp_proc_form_service') do response = subject.vnp_proc_form_create(options) - expect(response[:comp_id][:vnp_proc_id]).to eq '3830249' + expect(response[:comp_id][:vnp_proc_id]).to eq '3831394' end end end diff --git a/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml b/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml index 574bf1c8f44..628c8e3c426 100644 --- a/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml +++ b/spec/support/vcr_cassettes/bgs/vnp_proc_service_v2/vnp_proc_form_service.yml @@ -19,7 +19,7 @@ http_interactions: message: OK headers: Date: - - Wed, 27 Mar 2024 13:51:27 GMT + - Wed, 27 Mar 2024 18:49:03 GMT Server: - Apache X-Frame-Options: @@ -145,7 +145,7 @@ http_interactions: - recorded_at: Wed, 27 Mar 2024 13:51:27 GMT + recorded_at: Wed, 27 Mar 2024 18:49:03 GMT - request: method: post uri: https://internal-dsva-vagov-dev-fwdproxy-1893365470.us-gov-west-1.elb.amazonaws.com:4447/VnpProcFormWebServiceBean/VnpProcFormService @@ -173,10 +173,11 @@ http_interactions: - 3830249 - 21-22 + 3831394 + 21-22 - true/true/VAgovAPIUVAgovAPI + VAgovAPIUVAgovAPI + @@ -200,7 +201,7 @@ http_interactions: message: OK headers: Date: - - Wed, 27 Mar 2024 13:51:28 GMT + - Wed, 27 Mar 2024 18:49:04 GMT Server: - Apache X-Frame-Options: @@ -216,6 +217,6 @@ http_interactions: string: rO0ABXdKABR3ZWJsb2dpYy5hcHAudm5wLWVhcgAAANYAAAAjd2VibG9naWMud29ya2FyZWEuU3RyaW5nV29ya0NvbnRleHQABTIuMC44AAA=383024921-22VAgovAPIUVAgovAPI - recorded_at: Wed, 27 Mar 2024 13:51:29 GMT + xmlns:ns0="http://procFormService.services.vonapp.vba.va.gov/">383139421-22VAgovAPIUVAgovAPI + recorded_at: Wed, 27 Mar 2024 18:49:04 GMT recorded_with: VCR 6.2.0 From 058046d5d0e2e8291cb74de479ad428a52e8bc24 Mon Sep 17 00:00:00 2001 From: Matt Christianson Date: Wed, 27 Mar 2024 15:26:22 -0400 Subject: [PATCH 7/8] Remove unneeded nil handling for procId --- modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb b/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb index 3ae45265876..807af6c3047 100644 --- a/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb +++ b/modules/claims_api/lib/bgs_service/vnp_proc_form_service.rb @@ -7,7 +7,6 @@ class VnpProcFormService < ClaimsApi::LocalBGS def vnp_proc_form_create(options) vnp_proc_id = options[:vnp_proc_id] options.delete(:vnp_proc_id) - vnp_proc_id = '' if vnp_proc_id.blank? arg_strg = convert_nil_values(options) body = Nokogiri::XML::DocumentFragment.parse <<~EOXML From e635b90bb877a3e25b9dc6a8edf87ccd48be9d71 Mon Sep 17 00:00:00 2001 From: Matt Christianson Date: Thu, 28 Mar 2024 10:09:35 -0400 Subject: [PATCH 8/8] Remove comment from test --- .../spec/lib/claims_api/vnp_proc_form_service_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb index 4179e88e4ea..d75344c9256 100644 --- a/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb +++ b/modules/claims_api/spec/lib/claims_api/vnp_proc_form_service_spec.rb @@ -10,7 +10,7 @@ let(:options) { {} } it 'responds with a vnc_proc_id' do - options[:vnp_proc_id] = '3831394' # '3830252' '3854437' # + options[:vnp_proc_id] = '3831394' options[:vnp_ptcpnt_id] = nil options[:jrn_dt] = nil options[:jrn_obj_id] = 'VAgovAPI'