@Test public void testAnswer() { TestBatfish batfish = new TestBatfish(); ConversionStatusAnswerer answerer = new ConversionStatusAnswerer(new ConversionStatusQuestion(), batfish); TableAnswerElement answer = answerer.answer(batfish.getSnapshot()); assertThat( answer.getRows(), equalTo( new Rows() .add(Row.of(COL_NODE, "n1", COL_CONVERT_STATUS, ConvertStatus.PASSED)) .add(Row.of(COL_NODE, "n2", COL_CONVERT_STATUS, ConvertStatus.WARNINGS)) .add(Row.of(COL_NODE, "n3", COL_CONVERT_STATUS, ConvertStatus.FAILED)))); }
@Override public TableAnswerElement answer(NetworkSnapshot snapshot) { ConvertConfigurationAnswerElement ccae = _batfish.loadConvertConfigurationAnswerElementOrReparse(snapshot); Rows rows = new Rows(); ccae.getConvertStatus() .forEach( (nodeName, nodeStatus) -> { rows.add(getRow(nodeName, nodeStatus)); }); TableAnswerElement answerElement = new TableAnswerElement(TABLE_METADATA); answerElement.postProcessAnswer(_question, rows.getData()); return answerElement; }
ConversionStatusAnswerer extends Answerer { @Override public TableAnswerElement answer(NetworkSnapshot snapshot) { ConvertConfigurationAnswerElement ccae = _batfish.loadConvertConfigurationAnswerElementOrReparse(snapshot); Rows rows = new Rows(); ccae.getConvertStatus() .forEach( (nodeName, nodeStatus) -> { rows.add(getRow(nodeName, nodeStatus)); }); TableAnswerElement answerElement = new TableAnswerElement(TABLE_METADATA); answerElement.postProcessAnswer(_question, rows.getData()); return answerElement; } }
ConversionStatusAnswerer extends Answerer { @Override public TableAnswerElement answer(NetworkSnapshot snapshot) { ConvertConfigurationAnswerElement ccae = _batfish.loadConvertConfigurationAnswerElementOrReparse(snapshot); Rows rows = new Rows(); ccae.getConvertStatus() .forEach( (nodeName, nodeStatus) -> { rows.add(getRow(nodeName, nodeStatus)); }); TableAnswerElement answerElement = new TableAnswerElement(TABLE_METADATA); answerElement.postProcessAnswer(_question, rows.getData()); return answerElement; } ConversionStatusAnswerer(ConversionStatusQuestion question, IBatfish batfish); }
ConversionStatusAnswerer extends Answerer { @Override public TableAnswerElement answer(NetworkSnapshot snapshot) { ConvertConfigurationAnswerElement ccae = _batfish.loadConvertConfigurationAnswerElementOrReparse(snapshot); Rows rows = new Rows(); ccae.getConvertStatus() .forEach( (nodeName, nodeStatus) -> { rows.add(getRow(nodeName, nodeStatus)); }); TableAnswerElement answerElement = new TableAnswerElement(TABLE_METADATA); answerElement.postProcessAnswer(_question, rows.getData()); return answerElement; } ConversionStatusAnswerer(ConversionStatusQuestion question, IBatfish batfish); @Override TableAnswerElement answer(NetworkSnapshot snapshot); }
ConversionStatusAnswerer extends Answerer { @Override public TableAnswerElement answer(NetworkSnapshot snapshot) { ConvertConfigurationAnswerElement ccae = _batfish.loadConvertConfigurationAnswerElementOrReparse(snapshot); Rows rows = new Rows(); ccae.getConvertStatus() .forEach( (nodeName, nodeStatus) -> { rows.add(getRow(nodeName, nodeStatus)); }); TableAnswerElement answerElement = new TableAnswerElement(TABLE_METADATA); answerElement.postProcessAnswer(_question, rows.getData()); return answerElement; } ConversionStatusAnswerer(ConversionStatusQuestion question, IBatfish batfish); @Override TableAnswerElement answer(NetworkSnapshot snapshot);  }