@Test public void test_should_index_document() throws UnsupportedEncodingException { final ServiceRequestDocument expectedDocumentToIndex = new ServiceRequestDocument(); final HashMap<String, Object> sevaRequestMap = getSevaRequestMap(); when(documentService.enrich(any(SevaRequest.class))).thenReturn(expectedDocumentToIndex); indexerListener.listen(sevaRequestMap); verify(elasticSearchRepository).index(expectedDocumentToIndex); }
@KafkaListener(topics = "${kafka.topics.egov.index.name}") public void listen(HashMap<String, Object> sevaRequestMap) throws UnsupportedEncodingException { SevaRequest sevaRequest = objectMapper.convertValue(sevaRequestMap, SevaRequest.class); final ServiceRequestDocument document = documentService.enrich(sevaRequest); elasticSearchRepository.index(document); }
IndexerListener { @KafkaListener(topics = "${kafka.topics.egov.index.name}") public void listen(HashMap<String, Object> sevaRequestMap) throws UnsupportedEncodingException { SevaRequest sevaRequest = objectMapper.convertValue(sevaRequestMap, SevaRequest.class); final ServiceRequestDocument document = documentService.enrich(sevaRequest); elasticSearchRepository.index(document); } }
IndexerListener { @KafkaListener(topics = "${kafka.topics.egov.index.name}") public void listen(HashMap<String, Object> sevaRequestMap) throws UnsupportedEncodingException { SevaRequest sevaRequest = objectMapper.convertValue(sevaRequestMap, SevaRequest.class); final ServiceRequestDocument document = documentService.enrich(sevaRequest); elasticSearchRepository.index(document); } @Autowired  IndexerListener(ElasticSearchRepository elasticSearchRepository,
                           ObjectMapper objectMapper,
                           DocumentService documentService); }
IndexerListener { @KafkaListener(topics = "${kafka.topics.egov.index.name}") public void listen(HashMap<String, Object> sevaRequestMap) throws UnsupportedEncodingException { SevaRequest sevaRequest = objectMapper.convertValue(sevaRequestMap, SevaRequest.class); final ServiceRequestDocument document = documentService.enrich(sevaRequest); elasticSearchRepository.index(document); } @Autowired  IndexerListener(ElasticSearchRepository elasticSearchRepository,
                           ObjectMapper objectMapper,
                           DocumentService documentService); @KafkaListener(topics = "${kafka.topics.egov.index.name}") void listen(HashMap<String, Object> sevaRequestMap); }
IndexerListener { @KafkaListener(topics = "${kafka.topics.egov.index.name}") public void listen(HashMap<String, Object> sevaRequestMap) throws UnsupportedEncodingException { SevaRequest sevaRequest = objectMapper.convertValue(sevaRequestMap, SevaRequest.class); final ServiceRequestDocument document = documentService.enrich(sevaRequest); elasticSearchRepository.index(document); } @Autowired  IndexerListener(ElasticSearchRepository elasticSearchRepository,
                           ObjectMapper objectMapper,
                           DocumentService documentService); @KafkaListener(topics = "${kafka.topics.egov.index.name}") void listen(HashMap<String, Object> sevaRequestMap);  }