@Test public void testAddToQue() { Mockito.doNothing().when(functionQueueRepository).add(Mockito.any()); FunctionRequest request = new FunctionRequest(); request.setRequestInfo(getRequestInfo()); request.setFunctions(new ArrayList<FunctionContract>()); request.getFunctions().add(getFunctionContract()); functionRepository.addToQue(request); Map<String, Object> message = new HashMap<>(); message.put("function_create", request); Mockito.verify(functionQueueRepository).add(message); }
public void addToQue(FunctionRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("function_create", request); } else { message.put("function_update", request); } functionQueueRepository.add(message); }
FunctionRepository { public void addToQue(FunctionRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("function_create", request); } else { message.put("function_update", request); } functionQueueRepository.add(message); } }
FunctionRepository { public void addToQue(FunctionRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("function_create", request); } else { message.put("function_update", request); } functionQueueRepository.add(message); } @Autowired  FunctionRepository(FunctionJdbcRepository functionJdbcRepository,
			MastersQueueRepository functionQueueRepository, FinancialConfigurationService financialConfigurationService,
			FunctionESRepository functionESRepository, @Value("${persist.through.kafka}") String persistThroughKafka); }
FunctionRepository { public void addToQue(FunctionRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("function_create", request); } else { message.put("function_update", request); } functionQueueRepository.add(message); } @Autowired  FunctionRepository(FunctionJdbcRepository functionJdbcRepository,
			MastersQueueRepository functionQueueRepository, FinancialConfigurationService financialConfigurationService,
			FunctionESRepository functionESRepository, @Value("${persist.through.kafka}") String persistThroughKafka); @Transactional List<Function> save(List<Function> functions, RequestInfo requestInfo); @Transactional List<Function> update(List<Function> functions, RequestInfo requestInfo); String getNextSequence(); Function findById(Function function); @Transactional Function save(Function function); @Transactional Function update(Function function); void addToQue(FunctionRequest request); void addToSearchQueue(FunctionRequest request); Pagination<Function> search(FunctionSearch domain); boolean uniqueCheck(String fieldName, Function function); }
FunctionRepository { public void addToQue(FunctionRequest request) { Map<String, Object> message = new HashMap<>(); if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { message.put("function_create", request); } else { message.put("function_update", request); } functionQueueRepository.add(message); } @Autowired  FunctionRepository(FunctionJdbcRepository functionJdbcRepository,
			MastersQueueRepository functionQueueRepository, FinancialConfigurationService financialConfigurationService,
			FunctionESRepository functionESRepository, @Value("${persist.through.kafka}") String persistThroughKafka); @Transactional List<Function> save(List<Function> functions, RequestInfo requestInfo); @Transactional List<Function> update(List<Function> functions, RequestInfo requestInfo); String getNextSequence(); Function findById(Function function); @Transactional Function save(Function function); @Transactional Function update(Function function); void addToQue(FunctionRequest request); void addToSearchQueue(FunctionRequest request); Pagination<Function> search(FunctionSearch domain); boolean uniqueCheck(String fieldName, Function function);  }