@Test public void testComputeAnswerMetadataUnsuccessfulAnswer() { Answer testAnswer = new Answer(); testAnswer.setStatus(AnswerStatus.FAILURE); assertThat( AnswerMetadataUtil.computeAnswerMetadata(testAnswer, _logger), equalTo(AnswerMetadata.forStatus(AnswerStatus.FAILURE))); }
public static @Nonnull AnswerMetadata computeAnswerMetadata( @Nonnull Answer answer, @Nonnull BatfishLogger logger) { try { return AnswerMetadata.builder() .setMetrics(computeMetrics(answer, logger)) .setStatus(answer.getStatus()) .build(); } catch (Exception e) { return AnswerMetadata.forStatus(AnswerStatus.FAILURE); } }
AnswerMetadataUtil { public static @Nonnull AnswerMetadata computeAnswerMetadata( @Nonnull Answer answer, @Nonnull BatfishLogger logger) { try { return AnswerMetadata.builder() .setMetrics(computeMetrics(answer, logger)) .setStatus(answer.getStatus()) .build(); } catch (Exception e) { return AnswerMetadata.forStatus(AnswerStatus.FAILURE); } } }
AnswerMetadataUtil { public static @Nonnull AnswerMetadata computeAnswerMetadata( @Nonnull Answer answer, @Nonnull BatfishLogger logger) { try { return AnswerMetadata.builder() .setMetrics(computeMetrics(answer, logger)) .setStatus(answer.getStatus()) .build(); } catch (Exception e) { return AnswerMetadata.forStatus(AnswerStatus.FAILURE); } } private  AnswerMetadataUtil(); }
AnswerMetadataUtil { public static @Nonnull AnswerMetadata computeAnswerMetadata( @Nonnull Answer answer, @Nonnull BatfishLogger logger) { try { return AnswerMetadata.builder() .setMetrics(computeMetrics(answer, logger)) .setStatus(answer.getStatus()) .build(); } catch (Exception e) { return AnswerMetadata.forStatus(AnswerStatus.FAILURE); } } private  AnswerMetadataUtil(); static @Nonnull AnswerMetadata computeAnswerMetadata(
      @Nonnull Answer answer, @Nonnull BatfishLogger logger); }
AnswerMetadataUtil { public static @Nonnull AnswerMetadata computeAnswerMetadata( @Nonnull Answer answer, @Nonnull BatfishLogger logger) { try { return AnswerMetadata.builder() .setMetrics(computeMetrics(answer, logger)) .setStatus(answer.getStatus()) .build(); } catch (Exception e) { return AnswerMetadata.forStatus(AnswerStatus.FAILURE); } } private  AnswerMetadataUtil(); static @Nonnull AnswerMetadata computeAnswerMetadata(
      @Nonnull Answer answer, @Nonnull BatfishLogger logger);  }