@Test public void test_add_to_queue_while_update() { final BudgetReAppropriationRequest request = new BudgetReAppropriationRequest(); request.setBudgetReAppropriations(getBudgetReAppropriations()); request.setRequestInfo(new RequestInfo()); request.getRequestInfo().setAction("update"); budgetReAppropriationQueueRepository.addToQue(request); final ArgumentCaptor<HashMap> argumentCaptor = ArgumentCaptor.forClass(HashMap.class); verify(financialProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); final HashMap<String, Object> actualRequest = argumentCaptor.getValue(); assertEquals(request, actualRequest.get("budgetreappropriation_update")); }
public void addToQue(final BudgetReAppropriationRequest request) { final HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("budgetreappropriation_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("budgetreappropriation_update", request); break; case "delete": topicMap.put("budgetreappropriation_delete", request); break; } financialProducer.sendMessage(validatedTopic, budgetReAppValidatedKey, topicMap); }
BudgetReAppropriationQueueRepository { public void addToQue(final BudgetReAppropriationRequest request) { final HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("budgetreappropriation_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("budgetreappropriation_update", request); break; case "delete": topicMap.put("budgetreappropriation_delete", request); break; } financialProducer.sendMessage(validatedTopic, budgetReAppValidatedKey, topicMap); } }
BudgetReAppropriationQueueRepository { public void addToQue(final BudgetReAppropriationRequest request) { final HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("budgetreappropriation_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("budgetreappropriation_update", request); break; case "delete": topicMap.put("budgetreappropriation_delete", request); break; } financialProducer.sendMessage(validatedTopic, budgetReAppValidatedKey, topicMap); } @Autowired  BudgetReAppropriationQueueRepository(final FinancialProducer financialProducer,
            @Value("${kafka.topics.egf.budget.service.validated.topic}") final String validatedTopic,
            @Value("${kafka.topics.egf.budget.budgetreapp.validated.key}") final String budgetReAppValidatedKey,
            @Value("${kafka.topics.egf.budget.service.completed.topic}") final String completedTopic,
            @Value("${kafka.topics.egf.budget.budgetreapp.completed.key}") final String budgetReAppCompletedKey); }
BudgetReAppropriationQueueRepository { public void addToQue(final BudgetReAppropriationRequest request) { final HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("budgetreappropriation_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("budgetreappropriation_update", request); break; case "delete": topicMap.put("budgetreappropriation_delete", request); break; } financialProducer.sendMessage(validatedTopic, budgetReAppValidatedKey, topicMap); } @Autowired  BudgetReAppropriationQueueRepository(final FinancialProducer financialProducer,
            @Value("${kafka.topics.egf.budget.service.validated.topic}") final String validatedTopic,
            @Value("${kafka.topics.egf.budget.budgetreapp.validated.key}") final String budgetReAppValidatedKey,
            @Value("${kafka.topics.egf.budget.service.completed.topic}") final String completedTopic,
            @Value("${kafka.topics.egf.budget.budgetreapp.completed.key}") final String budgetReAppCompletedKey); void addToQue(final BudgetReAppropriationRequest request); void addToSearchQue(final BudgetReAppropriationRequest request); }
BudgetReAppropriationQueueRepository { public void addToQue(final BudgetReAppropriationRequest request) { final HashMap<String, Object> topicMap = new HashMap<String, Object>(); switch (request.getRequestInfo().getAction().toLowerCase()) { case "create": topicMap.put("budgetreappropriation_create", request); System.out.println("push create topic" + request); break; case "update": topicMap.put("budgetreappropriation_update", request); break; case "delete": topicMap.put("budgetreappropriation_delete", request); break; } financialProducer.sendMessage(validatedTopic, budgetReAppValidatedKey, topicMap); } @Autowired  BudgetReAppropriationQueueRepository(final FinancialProducer financialProducer,
            @Value("${kafka.topics.egf.budget.service.validated.topic}") final String validatedTopic,
            @Value("${kafka.topics.egf.budget.budgetreapp.validated.key}") final String budgetReAppValidatedKey,
            @Value("${kafka.topics.egf.budget.service.completed.topic}") final String completedTopic,
            @Value("${kafka.topics.egf.budget.budgetreapp.completed.key}") final String budgetReAppCompletedKey); void addToQue(final BudgetReAppropriationRequest request); void addToSearchQue(final BudgetReAppropriationRequest request);  }