@Test public void test_add_to_queue_while_create() { InstrumentRequest request = new InstrumentRequest(); request.setInstruments(getInstruments()); request.setRequestInfo(new RequestInfo()); request.getRequestInfo().setAction("create"); instrumentQueueRepository.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("instrument_create")); }
public void addToQue(InstrumentRequest request) { HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("instrument_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("instrument_update", request); break; case "delete": topicMap.put("instrument_delete", request); break; } financialInstrumentProducer.sendMessage(validatedTopic, instrumentValidatedKey, topicMap); }
InstrumentQueueRepository { public void addToQue(InstrumentRequest request) { HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("instrument_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("instrument_update", request); break; case "delete": topicMap.put("instrument_delete", request); break; } financialInstrumentProducer.sendMessage(validatedTopic, instrumentValidatedKey, topicMap); } }
InstrumentQueueRepository { public void addToQue(InstrumentRequest request) { HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("instrument_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("instrument_update", request); break; case "delete": topicMap.put("instrument_delete", request); break; } financialInstrumentProducer.sendMessage(validatedTopic, instrumentValidatedKey, topicMap); } @Autowired  InstrumentQueueRepository(FinancialInstrumentProducer financialInstrumentProducer,
            @Value("${kafka.topics.egf.instrument.validated.topic}") String validatedTopic,
            @Value("${kafka.topics.egf.instrument.instrument.validated.key}") String instrumentValidatedKey,
            @Value("${kafka.topics.egf.instrument.completed.topic}") String completedTopic,
            @Value("${kafka.topics.egf.instrument.instrument.completed.key}") String instrumentCompletedKey); }
InstrumentQueueRepository { public void addToQue(InstrumentRequest request) { HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("instrument_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("instrument_update", request); break; case "delete": topicMap.put("instrument_delete", request); break; } financialInstrumentProducer.sendMessage(validatedTopic, instrumentValidatedKey, topicMap); } @Autowired  InstrumentQueueRepository(FinancialInstrumentProducer financialInstrumentProducer,
            @Value("${kafka.topics.egf.instrument.validated.topic}") String validatedTopic,
            @Value("${kafka.topics.egf.instrument.instrument.validated.key}") String instrumentValidatedKey,
            @Value("${kafka.topics.egf.instrument.completed.topic}") String completedTopic,
            @Value("${kafka.topics.egf.instrument.instrument.completed.key}") String instrumentCompletedKey); void addToQue(InstrumentRequest request); void addToSearchQue(InstrumentRequest request); }
InstrumentQueueRepository { public void addToQue(InstrumentRequest request) { HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("instrument_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("instrument_update", request); break; case "delete": topicMap.put("instrument_delete", request); break; } financialInstrumentProducer.sendMessage(validatedTopic, instrumentValidatedKey, topicMap); } @Autowired  InstrumentQueueRepository(FinancialInstrumentProducer financialInstrumentProducer,
            @Value("${kafka.topics.egf.instrument.validated.topic}") String validatedTopic,
            @Value("${kafka.topics.egf.instrument.instrument.validated.key}") String instrumentValidatedKey,
            @Value("${kafka.topics.egf.instrument.completed.topic}") String completedTopic,
            @Value("${kafka.topics.egf.instrument.instrument.completed.key}") String instrumentCompletedKey); void addToQue(InstrumentRequest request); void addToSearchQue(InstrumentRequest request);  }