@Test public void testAddToQue() { Mockito.doNothing().when(accountEntityQueueRepository).add(Mockito.any()); AccountEntityRequest request = new AccountEntityRequest(); request.setRequestInfo(getRequestInfo()); request.setAccountEntities(new ArrayList<AccountEntityContract>()); request.getAccountEntities().add(getAccountEntityContract()); accountEntityRepository.addToQue(request); Map<String, Object> message = new HashMap<>(); message.put("accountentity_create", request); Mockito.verify(accountEntityQueueRepository).add(message); }
public void addToQue(AccountEntityRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("accountentity_create", request); } else { message.put("accountentity_update", request); } accountEntityQueueRepository.add(message); }
AccountEntityRepository { public void addToQue(AccountEntityRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("accountentity_create", request); } else { message.put("accountentity_update", request); } accountEntityQueueRepository.add(message); } }
AccountEntityRepository { public void addToQue(AccountEntityRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("accountentity_create", request); } else { message.put("accountentity_update", request); } accountEntityQueueRepository.add(message); } @Autowired  AccountEntityRepository(AccountEntityJdbcRepository accountEntityJdbcRepository,
                                   MastersQueueRepository accountEntityQueueRepository, FinancialConfigurationService financialConfigurationService,
                                   AccountEntityESRepository accountEntityESRepository, @Value("${persist.through.kafka}") String persistThroughKafka); }
AccountEntityRepository { public void addToQue(AccountEntityRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("accountentity_create", request); } else { message.put("accountentity_update", request); } accountEntityQueueRepository.add(message); } @Autowired  AccountEntityRepository(AccountEntityJdbcRepository accountEntityJdbcRepository,
                                   MastersQueueRepository accountEntityQueueRepository, FinancialConfigurationService financialConfigurationService,
                                   AccountEntityESRepository accountEntityESRepository, @Value("${persist.through.kafka}") String persistThroughKafka); @Transactional List<AccountEntity> save(List<AccountEntity> accountEntities, RequestInfo requestInfo); @Transactional List<AccountEntity> update(List<AccountEntity> accountEntities, RequestInfo requestInfo); void addToQue(AccountEntityRequest request); void addToSearchQueue(AccountEntityRequest request); AccountEntity findById(AccountEntity accountEntity); String getNextSequence(); @Transactional AccountEntity save(AccountEntity accountEntity); @Transactional AccountEntity update(AccountEntity accountEntity); void add(AccountEntityRequest request); Pagination<AccountEntity> search(AccountEntitySearch domain); boolean uniqueCheck(String fieldName, AccountEntity accountEntity); }
AccountEntityRepository { public void addToQue(AccountEntityRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("accountentity_create", request); } else { message.put("accountentity_update", request); } accountEntityQueueRepository.add(message); } @Autowired  AccountEntityRepository(AccountEntityJdbcRepository accountEntityJdbcRepository,
                                   MastersQueueRepository accountEntityQueueRepository, FinancialConfigurationService financialConfigurationService,
                                   AccountEntityESRepository accountEntityESRepository, @Value("${persist.through.kafka}") String persistThroughKafka); @Transactional List<AccountEntity> save(List<AccountEntity> accountEntities, RequestInfo requestInfo); @Transactional List<AccountEntity> update(List<AccountEntity> accountEntities, RequestInfo requestInfo); void addToQue(AccountEntityRequest request); void addToSearchQueue(AccountEntityRequest request); AccountEntity findById(AccountEntity accountEntity); String getNextSequence(); @Transactional AccountEntity save(AccountEntity accountEntity); @Transactional AccountEntity update(AccountEntity accountEntity); void add(AccountEntityRequest request); Pagination<AccountEntity> search(AccountEntitySearch domain); boolean uniqueCheck(String fieldName, AccountEntity accountEntity);  }