RpcStreamConnection extends RpcConnection { private void processFuncName(@Nonnull RpcPacket packet, @Nonnull RpcPacketSupplier supplier) { byte[] nameBytes = marshalPacketField(RpcFunctionMapKey.FUNCTION, packet.getFuncNameString()); reallocateSendBufferInPutPacketIfRunOut(supplier, nameBytes, nameBytes.length); } RpcStreamConnection(String serverHost, int serverPort, Properties props,
                               ServerStats stats, P4Charset p4Charset, boolean secure); private  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, P4Charset p4Charset, Socket socket, boolean secure); private  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, P4Charset p4Charset, Socket socket, RpcSocketPool pool, boolean secure);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, P4Charset p4Charset, 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 processFuncName() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { String[] args = { "value1" }; RpcPacket packet = RpcPacket.constructRpcPacket(RpcFunctionSpec.CLIENT_ACK, "test", args, null); RpcStreamConnection.RpcPacketSupplier supplier = createMockRpcPacketSupplier(); Method processFuncName = getPrivateMethod(RpcStreamConnection.class, "processFuncName", RpcPacket.class, RpcStreamConnection.RpcPacketSupplier.class); processFuncName.invoke(mockConnection, packet, supplier); verifyMockRpcPacketSupplier(supplier, 1); }