NhinAdminDistributionProxyWebServiceSecuredImpl implements NhinAdminDistributionProxy { @Override @NwhinInvocationEvent(beforeBuilder = EDXLDistributionEventDescriptionBuilder.class, afterReturningBuilder = EDXLDistributionEventDescriptionBuilder.class, serviceType = "Admin Distribution", version = "") public void sendAlertMessage(EDXLDistribution body, AssertionType assertion, NhinTargetSystemType target, NhincConstants.GATEWAY_API_LEVEL apiLevel) { LOG.debug("begin sendAlertMessage"); auditMessage(body, assertion, NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION, target); String url = getHelper().getUrl(target, NhincConstants.NHIN_ADMIN_DIST_SERVICE_NAME, apiLevel); try { if (NullChecker.isNotNullish(url)) { getAdminDistributionUtils().convertFileLocationToDataIfEnabled(body); ServicePortDescriptor<RespondingGatewayAdministrativeDistributionPortType> portDescriptor = getServicePortDescriptor(apiLevel); CONNECTClient<RespondingGatewayAdministrativeDistributionPortType> client = getCONNECTClientSecured( portDescriptor, url, assertion, target, NhincConstants.NHIN_ADMIN_DIST_SERVICE_NAME); if (apiLevel == GATEWAY_API_LEVEL.LEVEL_g1) { client.enableMtom(); } client.invokePort(RespondingGatewayAdministrativeDistributionPortType.class, "sendAlertMessage", body); } else { throw new WebServiceException("Could not determine URL for Nhin Admin Distribution endpoint"); } } catch (Exception ex) { throw new ErrorEventException(ex, "Unable to call Nhin Admin Distribution"); } }  ServicePortDescriptor<RespondingGatewayAdministrativeDistributionPortType> getServicePortDescriptor(
            NhincConstants.GATEWAY_API_LEVEL apiLevel); @Override @NwhinInvocationEvent(beforeBuilder = EDXLDistributionEventDescriptionBuilder.class, afterReturningBuilder = EDXLDistributionEventDescriptionBuilder.class, serviceType = "Admin Distribution", version = "") void sendAlertMessage(EDXLDistribution body, AssertionType assertion, NhinTargetSystemType target,
            NhincConstants.GATEWAY_API_LEVEL apiLevel);  }
@Test public void testNoMtom() { NhinAdminDistributionProxyWebServiceSecuredImpl impl = getImpl(); GATEWAY_API_LEVEL apiLevel = GATEWAY_API_LEVEL.LEVEL_g0; impl.sendAlertMessage(body, assertion, target, apiLevel); verify(client, never()).enableMtom(); }
@Test public void testMtom() { NhinAdminDistributionProxyWebServiceSecuredImpl impl = getImpl(); GATEWAY_API_LEVEL apiLevel = GATEWAY_API_LEVEL.LEVEL_g1; impl.sendAlertMessage(body, assertion, target, apiLevel); verify(client).enableMtom(); }