@Test public void testConfigToRow() { Mlag m = Mlag.builder() .setId("ID") .setPeerAddress(Ip.parse("1.1.1.1")) .setPeerInterface("Port-Channel1") .build(); final String hostname = "node"; Row r = configToRow(hostname, m); assertThat( r, equalTo( Row.builder(getMetadata().toColumnMap()) .put(COL_NODE, new Node(hostname)) .put(COL_MLAG_ID, m.getId()) .put(COL_MLAG_PEER_ADDRESS, m.getPeerAddress()) .put(COL_MLAG_PEER_INTERFACE, NodeInterfacePair.of(hostname, "Port-Channel1")) .put(COL_MLAG_LOCAL_INTERFACE, null) .build())); }
@VisibleForTesting @Nonnull static Row configToRow(String hostname, Mlag mlag) { return Row.builder(getMetadata().toColumnMap()) .put(COL_NODE, new Node(hostname)) .put(COL_MLAG_ID, mlag.getId()) .put(COL_MLAG_PEER_ADDRESS, mlag.getPeerAddress()) .put( COL_MLAG_PEER_INTERFACE, mlag.getPeerInterface() != null ? NodeInterfacePair.of(hostname, mlag.getPeerInterface()) : null) .put( COL_MLAG_LOCAL_INTERFACE, mlag.getLocalInterface() != null ? NodeInterfacePair.of(hostname, mlag.getLocalInterface()) : null) .build(); }
MlagPropertiesAnswerer extends Answerer { @VisibleForTesting @Nonnull static Row configToRow(String hostname, Mlag mlag) { return Row.builder(getMetadata().toColumnMap()) .put(COL_NODE, new Node(hostname)) .put(COL_MLAG_ID, mlag.getId()) .put(COL_MLAG_PEER_ADDRESS, mlag.getPeerAddress()) .put( COL_MLAG_PEER_INTERFACE, mlag.getPeerInterface() != null ? NodeInterfacePair.of(hostname, mlag.getPeerInterface()) : null) .put( COL_MLAG_LOCAL_INTERFACE, mlag.getLocalInterface() != null ? NodeInterfacePair.of(hostname, mlag.getLocalInterface()) : null) .build(); } }
MlagPropertiesAnswerer extends Answerer { @VisibleForTesting @Nonnull static Row configToRow(String hostname, Mlag mlag) { return Row.builder(getMetadata().toColumnMap()) .put(COL_NODE, new Node(hostname)) .put(COL_MLAG_ID, mlag.getId()) .put(COL_MLAG_PEER_ADDRESS, mlag.getPeerAddress()) .put( COL_MLAG_PEER_INTERFACE, mlag.getPeerInterface() != null ? NodeInterfacePair.of(hostname, mlag.getPeerInterface()) : null) .put( COL_MLAG_LOCAL_INTERFACE, mlag.getLocalInterface() != null ? NodeInterfacePair.of(hostname, mlag.getLocalInterface()) : null) .build(); } MlagPropertiesAnswerer(Question question, IBatfish batfish); }
MlagPropertiesAnswerer extends Answerer { @VisibleForTesting @Nonnull static Row configToRow(String hostname, Mlag mlag) { return Row.builder(getMetadata().toColumnMap()) .put(COL_NODE, new Node(hostname)) .put(COL_MLAG_ID, mlag.getId()) .put(COL_MLAG_PEER_ADDRESS, mlag.getPeerAddress()) .put( COL_MLAG_PEER_INTERFACE, mlag.getPeerInterface() != null ? NodeInterfacePair.of(hostname, mlag.getPeerInterface()) : null) .put( COL_MLAG_LOCAL_INTERFACE, mlag.getLocalInterface() != null ? NodeInterfacePair.of(hostname, mlag.getLocalInterface()) : null) .build(); } MlagPropertiesAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot); }
MlagPropertiesAnswerer extends Answerer { @VisibleForTesting @Nonnull static Row configToRow(String hostname, Mlag mlag) { return Row.builder(getMetadata().toColumnMap()) .put(COL_NODE, new Node(hostname)) .put(COL_MLAG_ID, mlag.getId()) .put(COL_MLAG_PEER_ADDRESS, mlag.getPeerAddress()) .put( COL_MLAG_PEER_INTERFACE, mlag.getPeerInterface() != null ? NodeInterfacePair.of(hostname, mlag.getPeerInterface()) : null) .put( COL_MLAG_LOCAL_INTERFACE, mlag.getLocalInterface() != null ? NodeInterfacePair.of(hostname, mlag.getLocalInterface()) : null) .build(); } MlagPropertiesAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot);  }