NhinDocSubmissionDeferredRequestProxyWebServiceSecuredImpl implements
NhinDocSubmissionDeferredRequestProxy { @Override @NwhinInvocationEvent(beforeBuilder = DocSubmissionBaseEventDescriptionBuilder.class, afterReturningBuilder = DocSubmissionBaseEventDescriptionBuilder.class, serviceType = "Document Submission Deferred Request", version = "1.1") public XDRAcknowledgementType provideAndRegisterDocumentSetBRequest11( ProvideAndRegisterDocumentSetRequestType request, AssertionType assertion, NhinTargetSystemType targetSystem) { LOG.debug("Begin provideAndRegisterDocumentSetBAsyncRequest"); XDRAcknowledgementType response = null; try { if (request == null) { throw new IllegalArgumentException("Request Message must be provided"); } else { String url = oProxyHelper.getUrlFromTargetSystemByGatewayAPILevel(targetSystem, NhincConstants.NHINC_XDR_REQUEST_SERVICE_NAME, GATEWAY_API_LEVEL.LEVEL_g0); getDocSubmissionUtils().convertFileLocationToDataIfEnabled(request); ServicePortDescriptor<XDRDeferredRequestPortType> portDescriptor = new NhinDocSubmissionDeferredRequestServicePortDescriptor(); CONNECTClient<XDRDeferredRequestPortType> client = getCONNECTClientSecured(portDescriptor, url, assertion, targetSystem, NhincConstants.NHINC_XDR_REQUEST_SERVICE_NAME); client.enableMtom(); response = (XDRAcknowledgementType) client.invokePort(XDRDeferredRequestPortType.class, "provideAndRegisterDocumentSetBDeferredRequest", request); } } catch (LargePayloadException lpe) { response = getMessageGeneratorUtils().createMissingDocumentXDRAcknowledgementType(); throw new ErrorEventException(lpe, response, "Unable to call Nhin Doc Query Deferred Request"); } catch (Exception ex) { response = getMessageGeneratorUtils().createRegistryErrorXDRAcknowledgementType(ex.getMessage()); throw new ErrorEventException(ex, response, "Unable to call Nhin Doc Query Deferred Request"); } finally { getDocSubmissionUtils().releaseFileLock(request); } LOG.debug("End provideAndRegisterDocumentSetBAsyncRequest"); return response; } NhinDocSubmissionDeferredRequestProxyWebServiceSecuredImpl(); @Override @NwhinInvocationEvent(beforeBuilder = DocSubmissionBaseEventDescriptionBuilder.class, afterReturningBuilder = DocSubmissionBaseEventDescriptionBuilder.class, serviceType = "Document Submission Deferred Request", version = "1.1") XDRAcknowledgementType provideAndRegisterDocumentSetBRequest11(
        ProvideAndRegisterDocumentSetRequestType request, AssertionType assertion, NhinTargetSystemType targetSystem);  }
@Test public void test() throws ExchangeManagerException, Exception { NhinDocSubmissionDeferredRequestProxyWebServiceSecuredImpl impl = getImpl(); NhinTargetSystemType targetSystem = new NhinTargetSystemType(); HomeCommunityType hcid = new HomeCommunityType(); hcid.setHomeCommunityId("1.1"); targetSystem.setHomeCommunity(hcid); when(proxyHelper.getUrlFromTargetSystemByGatewayAPILevel(targetSystem, NhincConstants.NHINC_XDR_REQUEST_SERVICE_NAME, NhincConstants.GATEWAY_API_LEVEL.LEVEL_g0)).thenReturn(""); impl.provideAndRegisterDocumentSetBRequest11(request, assertion, targetSystem); verify(client).enableMtom(); }