NhinPatientDiscoveryProxyWebServiceSecuredImpl implements NhinPatientDiscoveryProxy { @Override @NwhinInvocationEvent(beforeBuilder = PRPAIN201305UV02EventDescriptionBuilder.class, afterReturningBuilder = PRPAIN201306UV02EventDescriptionBuilder.class, serviceType = "Patient Discovery", version = "1.0") public PRPAIN201306UV02 respondingGatewayPRPAIN201305UV02(PRPAIN201305UV02 request, AssertionType assertion, NhinTargetSystemType target) throws Exception { PRPAIN201306UV02 response = new PRPAIN201306UV02(); try { if (request != null && target != null) { LOG.debug("Before target system URL look up."); String url = target.getUrl(); if (NullChecker.isNullish(url)) { url = ExchangeManager.getInstance().getDefaultEndpointURL( target.getHomeCommunity().getHomeCommunityId(), NhincConstants.PATIENT_DISCOVERY_SERVICE_NAME, target.getExchangeName()); LOG.debug("After target system URL look up. URL for service: {} is: {}" ,NhincConstants.PATIENT_DISCOVERY_SERVICE_NAME, url); } if (NullChecker.isNotNullish(url)) { ServicePortDescriptor<RespondingGatewayPortType> portDescriptor = new RespondingGatewayServicePortDescriptor(); CONNECTClient<RespondingGatewayPortType> client = getCONNECTSecuredClient(target, portDescriptor, url, assertion); response = (PRPAIN201306UV02) client.invokePort(RespondingGatewayPortType.class, "respondingGatewayPRPAIN201305UV02", request); } else { throw new WebServiceException("Could not determine URL for Patient Discovery Deferred Response endpoint"); } } else { throw new IllegalArgumentException("Request Message must be provided"); } } catch (Exception e) { PRPAIN201306UV02 errorResponse = new HL7PRPA201306Transforms().createPRPA201306ForErrors(request, NhincConstants.PATIENT_DISCOVERY_ANSWER_NOT_AVAIL_ERR_CODE, e.getMessage()); throw new ErrorEventException(e,errorResponse, "Unable to call Nhin Patient Discovery"); } return response; }  @Override @NwhinInvocationEvent(beforeBuilder = PRPAIN201305UV02EventDescriptionBuilder.class, afterReturningBuilder = PRPAIN201306UV02EventDescriptionBuilder.class, serviceType = "Patient Discovery", version = "1.0") PRPAIN201306UV02 respondingGatewayPRPAIN201305UV02(PRPAIN201305UV02 request, AssertionType assertion,
        NhinTargetSystemType target);  }
@Test public void testNoMtom() throws Exception { NhinPatientDiscoveryProxyWebServiceSecuredImpl impl = getImpl(); Mockito.when(target.getUrl()).thenReturn("localhost"); impl.respondingGatewayPRPAIN201305UV02(request, assertion, target); verify(client, never()).enableMtom(); }