CONNECTCXFClientUnsecured extends CONNECTCXFClient<T> { @Override public T getPort() { return serviceEndpoint.getPort(); } CONNECTCXFClientUnsecured(ServicePortDescriptor<T> portDescriptor, String url, String exchangeName, AssertionType assertion); @Override T getPort();  }
@Test public void ensureInterceptorCountIsConstant() { String url = "url"; AssertionType assertion = new AssertionType(); assertion.setTransactionTimeout(-1); CONNECTClient<TestServicePortType> client = createClient(url, assertion); Client cxfClient = ClientProxy.getClient(client.getPort()); int numInInterceptors = cxfClient.getInInterceptors().size(); int numOutInterceptors = cxfClient.getOutInterceptors().size(); createClient(url, assertion); createClient(url, assertion); CONNECTClient<TestServicePortType> client2 = createClient(url, assertion); Client cxfClient2 = ClientProxy.getClient(client2.getPort()); assertEquals(numInInterceptors, cxfClient2.getInInterceptors().size()); assertEquals(numOutInterceptors, cxfClient2.getOutInterceptors().size()); }
@Test public void testHttpsClientDisableCNCheckTrue() { String url = "https: AssertionType assertion = new AssertionType(); assertion.setTransactionTimeout(-1); CONNECTClient<TestServicePortType> endpoint = null; try { PropertyAccessor.getInstance().setProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.DISABLE_CN_CHECK, "true"); boolean disableCNCheck = PropertyAccessor.getInstance() .getPropertyBoolean(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.DISABLE_CN_CHECK); endpoint = createClient(url, assertion); Client client = ClientProxy.getClient(endpoint.getPort()); HTTPConduit conduit = (HTTPConduit) client.getConduit(); TLSClientParameters tlsPara = conduit.getTlsClientParameters(); Assert.assertTrue("disableCNCheck==true", tlsPara.isDisableCNCheck()); } catch (PropertyAccessException ex) { Assert.fail("Unable to set in memory property for disable-CN-Check."); } }
@Test public void testHttpsClientDisableCNCheckFalse() { String url = "https: AssertionType assertion = new AssertionType(); assertion.setTransactionTimeout(-1); CONNECTClient<TestServicePortType> endpoint = null; try { PropertyAccessor.getInstance().setProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.DISABLE_CN_CHECK, "false"); boolean disableCNCheck = PropertyAccessor.getInstance() .getPropertyBoolean(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.DISABLE_CN_CHECK); endpoint = createClient(url, assertion); Client client = ClientProxy.getClient(endpoint.getPort()); HTTPConduit conduit = (HTTPConduit) client.getConduit(); TLSClientParameters tlsPara = conduit.getTlsClientParameters(); Assert.assertFalse("disableCNCheck==false", tlsPara.isDisableCNCheck()); } catch (PropertyAccessException ex) { Assert.fail("Unable to set in memory property for disable-CN-Check."); } }