AbstractSubscribe extends AbstractRedisCommand<Object> implements Subscribe { @VisibleForTesting protected void handleResponse(Channel channel, Object response) { validateResponse(channel, response); if (channelResponsed.incrementAndGet() == subscribeChannel.length) { setSubscribeState(SUBSCRIBE_STATE.SUBSCRIBING); } } protected  AbstractSubscribe(String host, int port, ScheduledExecutorService scheduled,
                                Subscribe.MESSAGE_TYPE messageType, String... subscribeChannel);  AbstractSubscribe(String host, int port, ScheduledExecutorService scheduled, int commandTimeoutMilli,
                             MESSAGE_TYPE messageType, String... subscribeChannel);  AbstractSubscribe(SimpleObjectPool<NettyClient> clientPool, ScheduledExecutorService scheduled,
                             MESSAGE_TYPE messageType, String... subscribeChannel); @Override void addChannelListener(SubscribeListener listener); @Override void removeChannelListener(SubscribeListener listener); @Override ByteBuf getRequest(); @Override void unSubscribe();  }
@Test(expected = RedisRuntimeException.class) public void testHandleResponse1() { subscribe.handleResponse(null, "error"); }
@Test(expected = RedisRuntimeException.class) public void testHandleResponse2() throws IOException { Object[] response = new Object[]{new ByteArrayOutputStreamPayload("psubscribe"), new ByteArrayOutputStreamPayload("hello*"), (Long) 1L}; subscribe.handleResponse(null, response); }
@Test(expected = RedisRuntimeException.class) public void testHandleResponse3() throws IOException { Object[] response = new Object[]{new ByteArrayOutputStreamPayload("subscribe"), new ByteArrayOutputStreamPayload(channel)}; subscribe.handleResponse(null, response); }
@Test public void testHandleResponse4() throws IOException { Object[] response = new Object[]{new ByteArrayOutputStreamPayload(Subscribe.SUBSCRIBE), new ByteArrayOutputStreamPayload("channel"), (Long) 2L}; subscribe.handleResponse(null, response); }