@Test
public void testGetBackoffFailoverMetrics() throws JSONException {
ReportTestUtils.setupSinkFactory();
SinkBuilder bld = BackOffFailOverSink.builder();
EventSink snk = bld.build(new ReportTestingContext(), "one", "two");
ReportEvent rpt = snk.getMetrics();
LOG.info(ReportUtil.toJSONObject(rpt).toString());
assertNotNull(rpt.getLongMetric(BackOffFailOverSink.A_PRIMARY));
assertNotNull(rpt.getLongMetric(BackOffFailOverSink.A_FAILS));
assertNotNull(rpt.getLongMetric(BackOffFailOverSink.A_BACKUPS));
assertNull(rpt.getStringMetric("primary.one.name"));
assertNull(rpt.getStringMetric("backup.two.name"));
ReportEvent all = ReportUtil.getFlattenedReport(snk);
LOG.info(ReportUtil.toJSONObject(all).toString());
assertNotNull(all.getLongMetric(BackOffFailOverSink.A_PRIMARY));
assertNotNull(all.getLongMetric(BackOffFailOverSink.A_FAILS));
assertNotNull(all.getLongMetric(BackOffFailOverSink.A_BACKUPS));
assertEquals("One", all.getStringMetric("primary.One.name"));
assertEquals("Two", all.getStringMetric("backup.Two.name"));
}