@Test
public void testMultitableEvents() throws Exception {

    final String tablePrefix = "_multitable_";
    final String multiTableAName = tablePrefix + "a_";
    final String multiTableBName = tablePrefix + "_multitable_b_";
    final Table multitableA = mock(Table.class);
    final Table multitableB = mock(Table.class);
    when(tablePool.getTable(TableName.valueOf(multiTableAName))).thenReturn(multitableA);
    when(tablePool.getTable(TableName.valueOf(multiTableBName))).thenReturn(multitableB);
    final IndexerConf indexerConf = new IndexerConfBuilder().table(tablePrefix + ".*").build();
    ResultToSolrMapper mapper = createHbaseToSolrMapper(true);
    Indexer indexer = Indexer.createIndexer("index name", indexerConf, tablePrefix+ ".*", mapper, tablePool, null, solrDocumentWriter);
    IndexingEventListener indexingEventListener = new IndexingEventListener(indexer, tablePrefix+ ".*", true);
    List<Cell> kvs = Lists.newArrayList(
            (Cell)new KeyValue(Bytes.toBytes("row1"), Bytes.toBytes("messages"), Bytes.toBytes("msg1"),
                    Bytes.toBytes("the message")), new KeyValue(Bytes.toBytes("row1"), Bytes.toBytes("messages"),
            Bytes.toBytes("msg2"), Bytes.toBytes("another message")));
    SepEvent event = new SepEvent(Bytes.toBytes(TABLE_B), null, null, null);
    indexingEventListener.processEvents(Collections.singletonList(event));
    verifyZeroInteractions(multitableA, multitableB, tableB, solrDocumentWriter);
    event = new SepEvent(Bytes.toBytes(multiTableBName), "row1".getBytes(Charsets.UTF_8), kvs, null);
    indexingEventListener.processEvents(Collections.singletonList(event));
    verify(solrDocumentWriter, atLeastOnce()).add(eq(-1), anyMap());
    event = new SepEvent(Bytes.toBytes(multiTableAName), "row1".getBytes(Charsets.UTF_8), kvs, null);
    indexingEventListener.processEvents(Collections.singletonList(event));
    verify(solrDocumentWriter, atLeastOnce()).add(eq(-1), anyMap());
}