@Test public void test_should_call_financialproducer_sendmessage_api_while_create() { BankBranchContractRequest bankBranchContractRequest = new BankBranchContractRequest(); bankBranchContractRequest.setRequestInfo(getRequestInfo()); bankBranchContractRequest.getRequestInfo().setAction("create"); bankBranchQueueRepository.push(bankBranchContractRequest); 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(bankBranchContractRequest, actualRequest.get("BankBranchCreate")); }
public void push(BankBranchContractRequest bankBranchContractRequest) { HashMap<String, Object> bankBranchContractRequestMap = new HashMap<String, Object>(); if ("create".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction())) bankBranchContractRequestMap.put("BankBranchCreate", bankBranchContractRequest); else if ("updateAll".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction()) || "update".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction())) bankBranchContractRequestMap.put("BankBranchUpdate", bankBranchContractRequest); financialProducer.sendMessage(bankBranchValidatedTopic, bankBranchValidatedKey, bankBranchContractRequestMap); }
BankBranchQueueRepository { public void push(BankBranchContractRequest bankBranchContractRequest) { HashMap<String, Object> bankBranchContractRequestMap = new HashMap<String, Object>(); if ("create".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction())) bankBranchContractRequestMap.put("BankBranchCreate", bankBranchContractRequest); else if ("updateAll".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction()) || "update".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction())) bankBranchContractRequestMap.put("BankBranchUpdate", bankBranchContractRequest); financialProducer.sendMessage(bankBranchValidatedTopic, bankBranchValidatedKey, bankBranchContractRequestMap); } }
BankBranchQueueRepository { public void push(BankBranchContractRequest bankBranchContractRequest) { HashMap<String, Object> bankBranchContractRequestMap = new HashMap<String, Object>(); if ("create".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction())) bankBranchContractRequestMap.put("BankBranchCreate", bankBranchContractRequest); else if ("updateAll".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction()) || "update".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction())) bankBranchContractRequestMap.put("BankBranchUpdate", bankBranchContractRequest); financialProducer.sendMessage(bankBranchValidatedTopic, bankBranchValidatedKey, bankBranchContractRequestMap); } @Autowired  BankBranchQueueRepository(FinancialProducer financialProducer,
			@Value("${kafka.topics.egf.masters.validated.topic}") String bankBranchValidatedTopic,
			@Value("${kafka.topics.egf.masters.bankbranch.validated.key}") String bankBranchValidatedKey); }
BankBranchQueueRepository { public void push(BankBranchContractRequest bankBranchContractRequest) { HashMap<String, Object> bankBranchContractRequestMap = new HashMap<String, Object>(); if ("create".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction())) bankBranchContractRequestMap.put("BankBranchCreate", bankBranchContractRequest); else if ("updateAll".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction()) || "update".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction())) bankBranchContractRequestMap.put("BankBranchUpdate", bankBranchContractRequest); financialProducer.sendMessage(bankBranchValidatedTopic, bankBranchValidatedKey, bankBranchContractRequestMap); } @Autowired  BankBranchQueueRepository(FinancialProducer financialProducer,
			@Value("${kafka.topics.egf.masters.validated.topic}") String bankBranchValidatedTopic,
			@Value("${kafka.topics.egf.masters.bankbranch.validated.key}") String bankBranchValidatedKey); void push(BankBranchContractRequest bankBranchContractRequest); }
BankBranchQueueRepository { public void push(BankBranchContractRequest bankBranchContractRequest) { HashMap<String, Object> bankBranchContractRequestMap = new HashMap<String, Object>(); if ("create".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction())) bankBranchContractRequestMap.put("BankBranchCreate", bankBranchContractRequest); else if ("updateAll".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction()) || "update".equalsIgnoreCase(bankBranchContractRequest.getRequestInfo().getAction())) bankBranchContractRequestMap.put("BankBranchUpdate", bankBranchContractRequest); financialProducer.sendMessage(bankBranchValidatedTopic, bankBranchValidatedKey, bankBranchContractRequestMap); } @Autowired  BankBranchQueueRepository(FinancialProducer financialProducer,
			@Value("${kafka.topics.egf.masters.validated.topic}") String bankBranchValidatedTopic,
			@Value("${kafka.topics.egf.masters.bankbranch.validated.key}") String bankBranchValidatedKey); void push(BankBranchContractRequest bankBranchContractRequest);  }