NhinDocSubmissionProxyWebServiceSecuredImpl implements NhinDocSubmissionProxy { @NwhinInvocationEvent(beforeBuilder = DocSubmissionBaseEventDescriptionBuilder.class, afterReturningBuilder = DocSubmissionBaseEventDescriptionBuilder.class, serviceType = "Document Submission", version = "") @Override public RegistryResponseType provideAndRegisterDocumentSetB(ProvideAndRegisterDocumentSetRequestType request, AssertionType assertion, NhinTargetSystemType targetSystem, NhincConstants.GATEWAY_API_LEVEL apiLevel) { LOG.debug("Begin provideAndRegisterDocumentSetB"); RegistryResponseType response = new RegistryResponseType(); try { String url = getWebServiceProxyHelper().getUrlFromTargetSystemByGatewayAPILevel(targetSystem, NhincConstants.NHINC_XDR_SERVICE_NAME, apiLevel); getDocSubmissionUtils().convertFileLocationToDataIfEnabled(request); ServicePortDescriptor<DocumentRepositoryXDRPortType> portDescriptor = getServicePortDescriptor(apiLevel); CONNECTClient<DocumentRepositoryXDRPortType> client = getCONNECTClientSecured(portDescriptor, assertion, url, targetSystem, NhincConstants.NHINC_XDR_SERVICE_NAME); client.enableMtom(); response = (RegistryResponseType) client.invokePort(DocumentRepositoryXDRPortType.class, "documentRepositoryProvideAndRegisterDocumentSetB", request); } catch (LargePayloadException lpe) { response = getMessageGeneratorUtils().createMissingDocumentRegistryResponse(); throw new ErrorEventException(lpe, response, "Unable to call Nhin Doc Submission"); } catch (Exception ex) { response = getMessageGeneratorUtils().createRegistryErrorResponseWithAckFailure(ex.getMessage()); throw new ErrorEventException(ex, response, "Unable to call Nhin Doc Submission"); } LOG.debug("End provideAndRegisterDocumentSetB"); return response; } NhinDocSubmissionProxyWebServiceSecuredImpl(); ServicePortDescriptor<DocumentRepositoryXDRPortType> getServicePortDescriptor(
        NhincConstants.GATEWAY_API_LEVEL apiLevel); @NwhinInvocationEvent(beforeBuilder = DocSubmissionBaseEventDescriptionBuilder.class, afterReturningBuilder = DocSubmissionBaseEventDescriptionBuilder.class, serviceType = "Document Submission", version = "") @Override RegistryResponseType provideAndRegisterDocumentSetB(ProvideAndRegisterDocumentSetRequestType request,
        AssertionType assertion, NhinTargetSystemType targetSystem, NhincConstants.GATEWAY_API_LEVEL apiLevel);  }
@Test public void testG0() throws ExchangeManagerException, Exception { NhinDocSubmissionProxyWebServiceSecuredImpl impl = getImpl(); NhinTargetSystemType targetSystem = getNhinTargetSystemType("1.1"); when(proxyHelper.getUrlFromTargetSystemByGatewayAPILevel(targetSystem, NhincConstants.NHINC_XDR_REQUEST_SERVICE_NAME, NhincConstants.GATEWAY_API_LEVEL.LEVEL_g0)).thenReturn(""); impl.provideAndRegisterDocumentSetB(request, assertion, targetSystem, GATEWAY_API_LEVEL.LEVEL_g0); verify(client).enableMtom(); }
@Test public void testG1() throws ExchangeManagerException, Exception { NhinDocSubmissionProxyWebServiceSecuredImpl impl = getImpl(); NhinTargetSystemType targetSystem = getNhinTargetSystemType("1.1"); when(proxyHelper.getUrlFromTargetSystemByGatewayAPILevel(targetSystem, NhincConstants.NHINC_XDR_REQUEST_SERVICE_NAME, NhincConstants.GATEWAY_API_LEVEL.LEVEL_g1)).thenReturn(""); impl.provideAndRegisterDocumentSetB(request, assertion, targetSystem, GATEWAY_API_LEVEL.LEVEL_g1); verify(client).enableMtom(); }