private static void network(XmlGenerator gen, ClientNetworkConfig network) {
        gen.open("network")
           .node("cluster-routing", null,
                   "mode", network.getClusterRoutingConfig().getRoutingMode().name())
           .node("redo-operation", network.isRedoOperation())
           .node("connection-timeout", network.getConnectionTimeout());

        clusterMembers(gen, network.getAddresses());
        socketOptions(gen, network.getSocketOptions());
        socketInterceptor(gen, network.getSocketInterceptorConfig());
        ssl(gen, network.getSSLConfig());
        cloud(gen, network.getCloudConfig());
        aliasedDiscoveryConfigsGenerator(gen, aliasedDiscoveryConfigsFrom(network));
        autoDetection(gen, network.getAutoDetectionConfig());
        discovery(gen, network.getDiscoveryConfig());
        outboundPort(gen, network.getOutboundPortDefinitions());
        icmp(gen, network.getClientIcmpPingConfig());

        gen.close();
    }
@Test
    public void network() {
        ClientNetworkConfig expected = new ClientNetworkConfig();
        expected.setRedoOperation(true)
                .setConnectionTimeout(randomInt())
                .addAddress(randomString())
                .setOutboundPortDefinitions(Collections.singleton(randomString()))
                .getClusterRoutingConfig().setRoutingMode(RoutingMode.MULTI_MEMBER);


        clientConfig.setNetworkConfig(expected);
        ClientNetworkConfig actual = newConfigViaGenerator().getNetworkConfig();

        assertEquals(RoutingMode.MULTI_MEMBER, actual.getClusterRoutingConfig().getRoutingMode());
        assertTrue(actual.isRedoOperation());
        assertEquals(expected.getConnectionTimeout(), actual.getConnectionTimeout());
        assertCollection(expected.getAddresses(), actual.getAddresses());
        assertCollection(expected.getOutboundPortDefinitions(), actual.getOutboundPortDefinitions());
    }