KeeperCommandHandler extends AbstractCommandHandler { @VisibleForTesting protected ProxyConnectProtocol getProxyProtocol(String[] args) { String[] protocolArr = new String[args.length - 4]; System.arraycopy(args, 4, protocolArr, 0, protocolArr.length); String scheme = protocolArr[protocolArr.length - 1]; protocolArr[protocolArr.length - 1] = String.format("%s: String protocol = StringUtil.join(WHITE_SPACE, protocolArr); logger.info("[getProxyProtocol] protocol: {}", protocol); return new DefaultProxyConnectProtocolParser().read(protocol); }  @Override String[] getCommands();  }
@Test public void testGetProxyProtocol() { final String command = "setstate ACTIVE 127.0.0.1 6379 PROXY ROUTE PROXYTCP: ProxyConnectProtocol protocol = handler.getProxyProtocol(command.split(WHITE_SPACE)); System.out.println(protocol.getContent()); }