RedisCommandResult implements CommandResult { @Override public String getStatus() throws ConnectionException, IOException { final RedisStreamReader streamReader = getStreamReader(); checkMessageType(streamReader, RedisBytes.PLUS_BYTE); return streamReader.readString(); } RedisCommandResult(final Connection connection); @Override byte[] getBytes(); @Override String getStatus(); @Override int getInt();  }
@Test public void getStatus() throws ConnectionException, IOException { String status = "OK"; doReturn(status).when(streamReader).readString(); doReturn(RedisBytes.PLUS_BYTE).when(streamReader).readByte(); String actualStatus = commandResult.getStatus(); assertEquals(status, actualStatus); }