NhinDocSubmissionDeferredRequestProxyWebServiceSecuredImpl implements
NhinDocSubmissionDeferredRequestProxy { @NwhinInvocationEvent(beforeBuilder = DocSubmissionBaseEventDescriptionBuilder.class, afterReturningBuilder = DocSubmissionBaseEventDescriptionBuilder.class, serviceType = "Document Submission Deferred Request", version = "2.0") @Override public RegistryResponseType provideAndRegisterDocumentSetBRequest20( ProvideAndRegisterDocumentSetRequestType request, AssertionType assertion, NhinTargetSystemType targetSystem) { LOG.debug("Begin provideAndRegisterDocumentSetBAsyncRequest"); RegistryResponseType 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_g1); getDocSubmissionUtils().convertFileLocationToDataIfEnabled(request); ServicePortDescriptor<XDRDeferredRequest20PortType> portDescriptor = new NhinDocSubmissionDeferredRequestServicePortDescriptor(); CONNECTClient<XDRDeferredRequest20PortType> client = getCONNECTClientSecured(portDescriptor, url, assertion, targetSystem, NhincConstants.NHINC_XDR_REQUEST_SERVICE_NAME); client.enableMtom(); response = (RegistryResponseType) client.invokePort(XDRDeferredRequest20PortType.class, "provideAndRegisterDocumentSetBDeferredRequest", request); } } catch (LargePayloadException lpe) { response = getMessageGeneratorUtils().createMissingDocumentRegistryResponse(); throw new ErrorEventException(lpe, response, "Unable to call Nhin Doc Query Deferred Request"); } catch (Exception ex) { response = getMessageGeneratorUtils().createRegistryErrorResponseWithAckFailure(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(); @NwhinInvocationEvent(beforeBuilder = DocSubmissionBaseEventDescriptionBuilder.class, afterReturningBuilder = DocSubmissionBaseEventDescriptionBuilder.class, serviceType = "Document Submission Deferred Request", version = "2.0") @Override RegistryResponseType provideAndRegisterDocumentSetBRequest20(
        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_g1)).thenReturn(""); impl.provideAndRegisterDocumentSetBRequest20(request, assertion, targetSystem); verify(client).enableMtom(); }