@Test public void test_should_index_document() { final List<ReceiptRequestDocument> expectedDocumentToIndex = new ArrayList<ReceiptRequestDocument>(); final HashMap<String, Object> sevaRequestMap = getReceiptRequestMap(); when(documentService.enrich(any(ReceiptRequest.class))).thenReturn(expectedDocumentToIndex); indexerListener.listen(sevaRequestMap); verify(elasticSearchRepository).index(expectedDocumentToIndex); }
@KafkaListener(topics = "${kafka.topics.egov.index.name}") public void listen(HashMap<String, Object> receiptRequestMap) { ReceiptRequest receiptRequest = objectMapper.convertValue(receiptRequestMap, ReceiptRequest.class); final List<ReceiptRequestDocument> documents = documentService.enrich(receiptRequest); log.debug("Documents pushed to elastic search : "+ documents.size() + " and ",documents); elasticSearchRepository.index(documents); }
IndexerListener { @KafkaListener(topics = "${kafka.topics.egov.index.name}") public void listen(HashMap<String, Object> receiptRequestMap) { ReceiptRequest receiptRequest = objectMapper.convertValue(receiptRequestMap, ReceiptRequest.class); final List<ReceiptRequestDocument> documents = documentService.enrich(receiptRequest); log.debug("Documents pushed to elastic search : "+ documents.size() + " and ",documents); elasticSearchRepository.index(documents); } }
IndexerListener { @KafkaListener(topics = "${kafka.topics.egov.index.name}") public void listen(HashMap<String, Object> receiptRequestMap) { ReceiptRequest receiptRequest = objectMapper.convertValue(receiptRequestMap, ReceiptRequest.class); final List<ReceiptRequestDocument> documents = documentService.enrich(receiptRequest); log.debug("Documents pushed to elastic search : "+ documents.size() + " and ",documents); elasticSearchRepository.index(documents); } @Autowired  IndexerListener(ElasticSearchRepository elasticSearchRepository,
                           ObjectMapper objectMapper,
                           DocumentService documentService); }
IndexerListener { @KafkaListener(topics = "${kafka.topics.egov.index.name}") public void listen(HashMap<String, Object> receiptRequestMap) { ReceiptRequest receiptRequest = objectMapper.convertValue(receiptRequestMap, ReceiptRequest.class); final List<ReceiptRequestDocument> documents = documentService.enrich(receiptRequest); log.debug("Documents pushed to elastic search : "+ documents.size() + " and ",documents); elasticSearchRepository.index(documents); } @Autowired  IndexerListener(ElasticSearchRepository elasticSearchRepository,
                           ObjectMapper objectMapper,
                           DocumentService documentService); @KafkaListener(topics = "${kafka.topics.egov.index.name}") void listen(HashMap<String, Object> receiptRequestMap); }
IndexerListener { @KafkaListener(topics = "${kafka.topics.egov.index.name}") public void listen(HashMap<String, Object> receiptRequestMap) { ReceiptRequest receiptRequest = objectMapper.convertValue(receiptRequestMap, ReceiptRequest.class); final List<ReceiptRequestDocument> documents = documentService.enrich(receiptRequest); log.debug("Documents pushed to elastic search : "+ documents.size() + " and ",documents); elasticSearchRepository.index(documents); } @Autowired  IndexerListener(ElasticSearchRepository elasticSearchRepository,
                           ObjectMapper objectMapper,
                           DocumentService documentService); @KafkaListener(topics = "${kafka.topics.egov.index.name}") void listen(HashMap<String, Object> receiptRequestMap);  }