@Test
public void shouldNotHandleQueryAllPeersV2WhenV2NotSupported() {

  // querying for peers using v2 should return an error when v2 is not supported.
  List<String> queries =
      Arrays.asList(
          "SELECT * FROM system.peers_v2",
          "select * from system.peers_v2",
          " select  *  from  system.peers_v2 ; ");
  for (String query : queries) {
    List<Action> node0Actions = handler.getActions(node0, queryFrame(query));
    assertThat(node0Actions).hasSize(1);
    Action node0Action = node0Actions.get(0);
    assertThat(node0Action).isInstanceOf(MessageResponseAction.class);
    Message node0Message = ((MessageResponseAction) node0Action).getMessage();
    // Should get an invalid error when querying v2 table and v2 is not supported.
    assertThat(node0Message).isError(INVALID);
  }
}