@Test
public void shouldHandleQueryLocalNode1() {

  // querying the local table should return node info for node1
  List<String> queries =
      Arrays.asList(
          "SELECT * FROM system.local WHERE key='local'",
          "select * from system.local where key='local'",
          " select * from system.local where key = 'local' ; ");
  for (String query : queries) {
    List<Action> node1Actions = handler.getActions(node1, queryFrame(query));
    assertThat(node1Actions).hasSize(1);
    Action node1Action = node1Actions.get(0);
    assertThat(node1Action).isInstanceOf(MessageResponseAction.class);
    Message node0Message = ((MessageResponseAction) node1Action).getMessage();
    assertThat(node0Message)
        .isRows()
        .hasRows(1)
        .hasColumnSpecs(17)
        .hasColumn(0, 0, "local")
        .hasColumn(0, 1, "COMPLETED")
        .hasColumn(0, 2, ((InetSocketAddress) node1.getAddress()).getAddress())
        .hasColumn(0, 3, ((InetSocketAddress) node1.getAddress()).getPort())
        .hasColumn(0, 4, ((InetSocketAddress) node1.getAddress()).getAddress())
        .hasColumn(0, 5, ((InetSocketAddress) node1.getAddress()).getPort())
        .hasColumn(0, 6, cluster.getName())
        .hasColumn(0, 7, "3.2.0")
        .hasColumn(0, 8, node1.getDataCenter().getName())
        .hasColumn(0, 9, ((InetSocketAddress) node1.getAddress()).getAddress())
        .hasColumn(0, 10, ((InetSocketAddress) node1.getAddress()).getPort())
        .hasColumn(0, 11, "org.apache.cassandra.dht.Murmur3Partitioner")
        .hasColumn(0, 12, "rack1")
        .hasColumn(0, 13, "3.0.12")
        .hasColumn(0, 14, Collections.singleton("0"))
        .hasColumn(0, 15, node1.getHostId())
        .hasColumn(0, 16, PeerMetadataHandler.schemaVersion);
  }
}