EntityPatientDiscoveryProxyWebServiceUnsecuredImpl extends EntityPatientDiscoveryProxyWebServicAbstract implements EntityPatientDiscoveryProxy { @Override protected String getEndpointURLFromExchange(String serviceName) throws ExchangeManagerException { return super.getEndpointURLFromExchange(serviceName); } EntityPatientDiscoveryProxyWebServiceUnsecuredImpl(); @Override RespondingGatewayPRPAIN201306UV02ResponseType respondingGatewayPRPAIN201305UV02(PRPAIN201305UV02 pdRequest,
        AssertionType assertion, NhinTargetCommunitiesType targetCommunities);  }
@Test public void testInvokeConnectionManagerHappy() { try { EntityPatientDiscoveryProxyWebServiceUnsecuredImpl webProxy = new EntityPatientDiscoveryProxyWebServiceUnsecuredImpl() { @Override protected WebServiceProxyHelper createWebServiceProxyHelper() { return mockWebServiceProxyHelper; } @Override protected String getEndpointURLFromExchange(String serviceName) throws ExchangeManagerException { return "test_endpoint"; } }; String endpointURL = webProxy.getEndpointURLFromExchange("not_used_by_override"); assertNotNull("EndpointURL was null", endpointURL); assertEquals("EndpointURL was not correct", "test_endpoint", endpointURL); } catch (Throwable t) { System.out.println("Error running testInvokeConnectionManagerHappy test: " + t.getMessage()); t.printStackTrace(); fail("Error running testInvokeConnectionManagerHappy test: " + t.getMessage()); } }
@Test(expected = gov.hhs.fha.nhinc.exchangemgr.ExchangeManagerException.class) public void testInvokeConnectionManagerException() throws ExchangeManagerException { EntityPatientDiscoveryProxyWebServiceUnsecuredImpl webProxy = new EntityPatientDiscoveryProxyWebServiceUnsecuredImpl() { @Override protected WebServiceProxyHelper createWebServiceProxyHelper() { return mockWebServiceProxyHelper; } @Override protected String getEndpointURLFromExchange(String serviceName) throws ExchangeManagerException { throw new ExchangeManagerException(); } }; webProxy.getEndpointURLFromExchange("not_used_by_override"); fail("Exception should have been thrown"); }