RpcStreamConnection extends RpcConnection { private void processStringArgs(@Nonnull RpcPacket packet, @Nonnull final RpcPacketSupplier argsSupplier) { String[] strArgs = packet.getStrArgs(); if (nonNull(strArgs)) { for (String arg : strArgs) { if (isNotBlank(arg)) { reallocateSendBufferInPutPacketIfRunOut(argsSupplier, marshalPacketField(null, arg), SENDBUF_REALLOC_INCR); } } } } RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, boolean secure);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, Socket socket);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, RpcSocketPool pool);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, Socket socket, boolean secure);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, RpcSocketPool pool, boolean secure);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, Socket socket, RpcSocketPool pool, boolean secure);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, Socket socket, RpcSocketPool pool, boolean secure,
            String rsh); String getServerIpPort(); String getClientIpPort(); void disconnect(final RpcPacketDispatcher dispatcher); RpcPacket getRpcPacket(); RpcPacket getRpcPacket(final RpcPacketFieldRule fieldRule,
            final IFilterCallback filterCallback); int getSystemRecvBufferSize(); int getSystemSendBufferSize(); long putRpcPackets(@Nonnull RpcPacket[] packets); long putRpcPacket(@Nonnull RpcPacket packet); @Override void useConnectionCompression(); static final String TRACE_PREFIX; }
@Test public void processStringArgs() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { String[] args = { "value1", "value2" }; RpcPacket packet = RpcPacket.constructRpcPacket(RpcFunctionSpec.CLIENT_ACK, "test", args, null); RpcStreamConnection.RpcPacketSupplier supplier = createMockRpcPacketSupplier(); Method processStringArgs = getPrivateMethod(RpcStreamConnection.class, "processStringArgs", RpcPacket.class, RpcStreamConnection.RpcPacketSupplier.class); processStringArgs.invoke(mockConnection, packet, supplier); verifyMockRpcPacketSupplier(supplier, args.length); }