@Test public void test_add_to_queue_while_update() { SurrenderReasonRequest request = new SurrenderReasonRequest(); request.setSurrenderReasons(getSurrenderReasons()); request.setRequestInfo(new RequestInfo()); request.getRequestInfo().setAction("update"); surrenderReasonQueueRepository.addToQue(request); final ArgumentCaptor<HashMap> argumentCaptor = ArgumentCaptor.forClass(HashMap.class); verify(financialInstrumentProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); final HashMap<String, Object> actualRequest = argumentCaptor.getValue(); assertEquals(request, actualRequest.get("surrenderreason_update")); }
public void addToQue(SurrenderReasonRequest request) { HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("surrenderreason_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("surrenderreason_update", request); break; case "delete": topicMap.put("surrenderreason_delete", request); break; } financialInstrumentProducer.sendMessage(validatedTopic, surrenderReasonValidatedKey, topicMap); }
SurrenderReasonQueueRepository { public void addToQue(SurrenderReasonRequest request) { HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("surrenderreason_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("surrenderreason_update", request); break; case "delete": topicMap.put("surrenderreason_delete", request); break; } financialInstrumentProducer.sendMessage(validatedTopic, surrenderReasonValidatedKey, topicMap); } }
SurrenderReasonQueueRepository { public void addToQue(SurrenderReasonRequest request) { HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("surrenderreason_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("surrenderreason_update", request); break; case "delete": topicMap.put("surrenderreason_delete", request); break; } financialInstrumentProducer.sendMessage(validatedTopic, surrenderReasonValidatedKey, topicMap); } @Autowired  SurrenderReasonQueueRepository(FinancialInstrumentProducer financialInstrumentProducer,
            @Value("${kafka.topics.egf.instrument.validated.topic}") String validatedTopic,
            @Value("${kafka.topics.egf.instrument.surrender.reason.validated.key}") String surrenderReasonValidatedKey,
            @Value("${kafka.topics.egf.instrument.completed.topic}") String completedTopic,
            @Value("${kafka.topics.egf.instrument.surrender.reason.completed.key}") String surrenderReasonCompletedKey); }
SurrenderReasonQueueRepository { public void addToQue(SurrenderReasonRequest request) { HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("surrenderreason_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("surrenderreason_update", request); break; case "delete": topicMap.put("surrenderreason_delete", request); break; } financialInstrumentProducer.sendMessage(validatedTopic, surrenderReasonValidatedKey, topicMap); } @Autowired  SurrenderReasonQueueRepository(FinancialInstrumentProducer financialInstrumentProducer,
            @Value("${kafka.topics.egf.instrument.validated.topic}") String validatedTopic,
            @Value("${kafka.topics.egf.instrument.surrender.reason.validated.key}") String surrenderReasonValidatedKey,
            @Value("${kafka.topics.egf.instrument.completed.topic}") String completedTopic,
            @Value("${kafka.topics.egf.instrument.surrender.reason.completed.key}") String surrenderReasonCompletedKey); void addToQue(SurrenderReasonRequest request); void addToSearchQue(SurrenderReasonRequest request); }
SurrenderReasonQueueRepository { public void addToQue(SurrenderReasonRequest request) { HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("surrenderreason_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("surrenderreason_update", request); break; case "delete": topicMap.put("surrenderreason_delete", request); break; } financialInstrumentProducer.sendMessage(validatedTopic, surrenderReasonValidatedKey, topicMap); } @Autowired  SurrenderReasonQueueRepository(FinancialInstrumentProducer financialInstrumentProducer,
            @Value("${kafka.topics.egf.instrument.validated.topic}") String validatedTopic,
            @Value("${kafka.topics.egf.instrument.surrender.reason.validated.key}") String surrenderReasonValidatedKey,
            @Value("${kafka.topics.egf.instrument.completed.topic}") String completedTopic,
            @Value("${kafka.topics.egf.instrument.surrender.reason.completed.key}") String surrenderReasonCompletedKey); void addToQue(SurrenderReasonRequest request); void addToSearchQue(SurrenderReasonRequest request);  }