@Test
public void shouldNotHandleQuerySpecificPeersV2NamedParameter() throws UnknownHostException {

  // when peers_v2 query is made, an invalid error should be raised is the handler does not
  // support v2.
  InetAddress addr = InetAddress.getByAddress(new byte[] {127, 0, 11, 17});
  Map<String, ByteBuffer> params = new HashMap<>();
  params.put("address", ByteBuffer.wrap(addr.getAddress()));
  ByteBuffer port = ByteBuffer.allocate(4);
  port.putInt(9042);
  port.flip();
  params.put("port", port);
  QueryOptions queryOptions =
      new QueryOptions(
          0, Collections.emptyList(), params, false, 0, null, 10, Long.MIN_VALUE, null);
  List<String> queries =
      Arrays.asList(
          "SELECT * FROM system.peers_v2 WHERE peer=:address AND peer_port=:port",
          "select * from system.peers_v2 where peer = :address and peer_port = :port",
          " select  *  from  system.peers_v2  where  peer = :address  and  peer_port = :port ; ");
  for (String query : queries) {
    List<Action> node0Actions = handler.getActions(node0, queryFrame(query, queryOptions));
    assertThat(node0Actions).hasSize(1);
    Action node0Action = node0Actions.get(0);
    assertThat(node0Action).isInstanceOf(MessageResponseAction.class);
    Message node0Message = ((MessageResponseAction) node0Action).getMessage();
    // should return an error.
    assertThat(node0Message).isError(INVALID);
  }
}