@Test public void test_addtoque1() { Mockito.doNothing().when(recoveryQueueRepository).add(Mockito.any()); RecoveryRequest request = new RecoveryRequest(); request.setRequestInfo(getRequestInfo()); request.getRequestInfo().setAction(Constants.ACTION_UPDATE); request.setRecoverys(new ArrayList<RecoveryContract>()); request.getRecoverys().add(getRecoveryContract()); recoveryRepository.addToQue(request); Map<String, Object> message = new HashMap<>(); message.put("recovery_update", request); Mockito.verify(recoveryQueueRepository).add(message); }
public void addToQue(RecoveryRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("recovery_create", request); } else { message.put("recovery_update", request); } recoveryQueueRepository.add(message); }
RecoveryRepository { public void addToQue(RecoveryRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("recovery_create", request); } else { message.put("recovery_update", request); } recoveryQueueRepository.add(message); } }
RecoveryRepository { public void addToQue(RecoveryRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("recovery_create", request); } else { message.put("recovery_update", request); } recoveryQueueRepository.add(message); } @Autowired  RecoveryRepository(MastersQueueRepository recoveryQueueRepository, FinancialConfigurationService financialConfigurationService,
                              @Value("${persist.through.kafka}") String persistThroughKafka,
                              RecoveryJdbcRepository recoveryJdbcRepository,
                              RecoveryESRepository recoveryESRepository); }
RecoveryRepository { public void addToQue(RecoveryRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("recovery_create", request); } else { message.put("recovery_update", request); } recoveryQueueRepository.add(message); } @Autowired  RecoveryRepository(MastersQueueRepository recoveryQueueRepository, FinancialConfigurationService financialConfigurationService,
                              @Value("${persist.through.kafka}") String persistThroughKafka,
                              RecoveryJdbcRepository recoveryJdbcRepository,
                              RecoveryESRepository recoveryESRepository); @Transactional List<Recovery> save(List<Recovery> recoveries,
                               RequestInfo requestInfo); @Transactional List<Recovery> update(List<Recovery> recoveries,
                                 RequestInfo requestInfo); String getNextSequence(); Recovery findById(Recovery recovery); @Transactional Recovery save(Recovery recovery); @Transactional Recovery update(Recovery recovery); void addToQue(RecoveryRequest request); void addToSearchQueue(RecoveryRequest request); Pagination<Recovery> search(RecoverySearch domain); boolean uniqueCheck(String fieldName, Recovery recovery); }
RecoveryRepository { public void addToQue(RecoveryRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("recovery_create", request); } else { message.put("recovery_update", request); } recoveryQueueRepository.add(message); } @Autowired  RecoveryRepository(MastersQueueRepository recoveryQueueRepository, FinancialConfigurationService financialConfigurationService,
                              @Value("${persist.through.kafka}") String persistThroughKafka,
                              RecoveryJdbcRepository recoveryJdbcRepository,
                              RecoveryESRepository recoveryESRepository); @Transactional List<Recovery> save(List<Recovery> recoveries,
                               RequestInfo requestInfo); @Transactional List<Recovery> update(List<Recovery> recoveries,
                                 RequestInfo requestInfo); String getNextSequence(); Recovery findById(Recovery recovery); @Transactional Recovery save(Recovery recovery); @Transactional Recovery update(Recovery recovery); void addToQue(RecoveryRequest request); void addToSearchQueue(RecoveryRequest request); Pagination<Recovery> search(RecoverySearch domain); boolean uniqueCheck(String fieldName, Recovery recovery);  }