/**
   * This test ensures that the interceptor count is the same no matter how many times the decorator
   * is called on the constructor.
   */
  @Test
  public void ensureInterceptorCountIsConstant() {
    CONNECTClient<TestServicePortType> client = createClient();

    Client cxfClient = ClientProxy.getClient(client.getPort());
    int numOutInterceptors = cxfClient.getOutInterceptors().size();

    createClient();
    createClient();
    CONNECTClient<TestServicePortType> client2 = createClient();

    Client cxfClient2 = ClientProxy.getClient(client2.getPort());
    assertEquals(numOutInterceptors, cxfClient2.getOutInterceptors().size());
  }
  /**
   * This method verifies that the passed in client is configured for Ws-Security properly.
   *
   * @param client
   */
  public void verifyWsSecurityProperties(CONNECTClient<?> client) {
    Client clientProxy = ClientProxy.getClient(client.getPort());

    WSS4JOutInterceptor wss4jInterceptor = null;
    for (Interceptor<? extends Message> interceptor : clientProxy.getOutInterceptors()) {
      if (interceptor instanceof WSS4JOutInterceptor) {
        wss4jInterceptor = (WSS4JOutInterceptor) interceptor;
        break;
      }
    }

    assertNotNull(wss4jInterceptor);
    assertTrue(wss4jInterceptor.isAllowMTOM());

    Map<String, Object> properties = wss4jInterceptor.getProperties();
    new WsSecurityConfigFactoryTest().verifyWsSecurityProperties(properties);
  }