@Test
public void testGetFanOutMetrics() throws JSONException, FlumeSpecException {

  ReportTestUtils.setupSinkFactory();
  EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(),
      "[ one, two, three]");
  ReportEvent rpt = snk.getMetrics();
  LOG.info(ReportUtil.toJSONObject(rpt).toString());
  assertEquals(3, rpt.getLongMetric(FanOutSink.R_SUBSINKS).longValue());
  assertNull(rpt.getStringMetric("Fanout[0].name"));
  assertNull(rpt.getStringMetric("Fanout[1].name"));
  assertNull(rpt.getStringMetric("Fanout[2].name"));
  ReportEvent all = ReportUtil.getFlattenedReport(snk);
  LOG.info(ReportUtil.toJSONObject(all).toString());
  assertEquals(3, rpt.getLongMetric(FanOutSink.R_SUBSINKS).longValue());
  assertEquals("One", all.getStringMetric("Fanout[0].name"));
  assertEquals("Two", all.getStringMetric("Fanout[1].name"));
  assertEquals("Three", all.getStringMetric("Fanout[2].name"));
}