AdapterDocSubmissionDeferredResponseProxyWebServiceSecuredImpl implements
        AdapterDocSubmissionDeferredResponseProxy { @AdapterDelegationEvent(beforeBuilder = DeferredResponseDescriptionBuilder.class, afterReturningBuilder = DocSubmissionArgTransformerBuilder.class, serviceType = "Document Submission Deferred Response", version = "LEVEL_a0") @Override public XDRAcknowledgementType provideAndRegisterDocumentSetBResponse(RegistryResponseType regResponse, AssertionType assertion) { LOG.debug("Begin AdapterDocSubmissionDeferredResponseProxyWebServiceSecuredImpl.provideAndRegisterDocumentSetBResponse"); XDRAcknowledgementType response = null; String serviceName = NhincConstants.ADAPTER_XDR_RESPONSE_SECURED_SERVICE_NAME; try { String url = oProxyHelper.getAdapterEndPointFromConnectionManager(serviceName); if (NullChecker.isNotNullish(url)) { ServicePortDescriptor<AdapterXDRResponseSecuredPortType> portDescriptor = new AdapterDocSubmissionDeferredResponseSecuredServicePortDescriptor(); CONNECTClient<AdapterXDRResponseSecuredPortType> client = getCONNECTClientSecured(portDescriptor, url, assertion); client.enableMtom(); response = (XDRAcknowledgementType) client.invokePort(AdapterXDRResponseSecuredPortType.class, "provideAndRegisterDocumentSetBResponse", regResponse); } else { throw new WebServiceException("Could not determine URL for Doc Submission Deferred Response Adapter endpoint"); } } catch (Exception ex) { throw new ErrorEventException(ex, "Unable to call Doc Submission Deferred Response Adapter"); } LOG.debug("End AdapterDocSubmissionDeferredResponseProxyWebServiceSecuredImpl.provideAndRegisterDocumentSetBResponse"); return response; } AdapterDocSubmissionDeferredResponseProxyWebServiceSecuredImpl(); @AdapterDelegationEvent(beforeBuilder = DeferredResponseDescriptionBuilder.class, afterReturningBuilder = DocSubmissionArgTransformerBuilder.class, serviceType = "Document Submission Deferred Response", version = "LEVEL_a0") @Override XDRAcknowledgementType provideAndRegisterDocumentSetBResponse(RegistryResponseType regResponse,
            AssertionType assertion);  }
@Test public void testProvideAndRegisterDocumentSetBResponse() { WebServiceProxyHelper proxyHelper = createMockWebServiceProxyHelper("url"); AdapterDocSubmissionDeferredResponseProxyWebServiceSecuredImpl adapterXDRResponseWebServiceProxy = createWebServiceProxy(proxyHelper); RegistryResponseType body = new RegistryResponseType(); AssertionType assertion = new AssertionType(); XDRAcknowledgementType result = adapterXDRResponseWebServiceProxy.provideAndRegisterDocumentSetBResponse(body, assertion); assertEquals(NhincConstants.XDR_ACK_STATUS_MSG, result.getMessage().getStatus()); }
@Test public void testProvideAndRegisterDocumentSetBResponseFailureCase() { WebServiceProxyHelper proxyHelper = createMockWebServiceProxyHelper(null); AdapterDocSubmissionDeferredResponseProxyWebServiceSecuredImpl adapterXDRResponseWebServiceProxy = createWebServiceProxy(proxyHelper); RegistryResponseType body = new RegistryResponseType(); AssertionType assertion = new AssertionType(); try { adapterXDRResponseWebServiceProxy.provideAndRegisterDocumentSetBResponse(body,assertion); fail("Didnt throw an exception!"); } catch (ErrorEventException e) { assertNull(e.getReturnOverride()); } }