EsPercolateBolt extends AbstractEsBolt { public EsPercolateBolt(EsConfig esConfig, EsTupleMapper tupleMapper) { super(esConfig); this.tupleMapper = checkNotNull(tupleMapper); } EsPercolateBolt(EsConfig esConfig, EsTupleMapper tupleMapper); @Override void prepare(Map map, TopologyContext topologyContext, OutputCollector outputCollector); @Override void execute(Tuple tuple); @Override void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer);  }
@Test public void testEsPercolateBolt() throws Exception { String source = "{\"user\":\"user1\"}"; String index = "index1"; String type = ".percolator"; node.client().prepareIndex("index1", ".percolator") .setId("1") .setSource("{\"query\":{\"match\":{\"user\":\"user1\"}}}"). execute().actionGet(); Tuple tuple = EsTestUtil.generateTestTuple(source, index, type, null); bolt.execute(tuple); verify(outputCollector).ack(tuple); verify(outputCollector).emit(new Values(source, any(PercolateResponse.Match.class))); }