@Test public void test_update() { InstrumentAccountCodeEntity entity = getInstrumentAccountCodeEntity(); InstrumentAccountCode expectedResult = entity.toDomain(); when(instrumentAccountCodeJdbcRepository.update(any(InstrumentAccountCodeEntity.class))).thenReturn(entity); InstrumentAccountCode actualResult = instrumentAccountCodeRepositoryWithKafka .update(getInstrumentAccountCodeDomin()); assertEquals(expectedResult.getAccountCode().getId(), actualResult.getAccountCode().getId()); assertEquals(expectedResult.getInstrumentType().getId(), actualResult.getInstrumentType().getId()); }
@Transactional public List<InstrumentAccountCode> update(List<InstrumentAccountCode> instrumentAccountCodes, RequestInfo requestInfo) { InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper(); if (persistThroughKafka != null && !persistThroughKafka.isEmpty() && persistThroughKafka.equalsIgnoreCase("yes")) { InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); request.setRequestInfo(requestInfo); request.setInstrumentAccountCodes(new ArrayList<>()); for (InstrumentAccountCode iac : instrumentAccountCodes) request.getInstrumentAccountCodes().add(mapper.toContract(iac)); instrumentAccountCodeQueueRepository.addToQue(request); return instrumentAccountCodes; } else { List<InstrumentAccountCode> resultList = new ArrayList<InstrumentAccountCode>(); for (InstrumentAccountCode iac : instrumentAccountCodes) resultList.add(update(iac)); InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); request.setRequestInfo(requestInfo); request.setInstrumentAccountCodes(new ArrayList<>()); for (InstrumentAccountCode iac : resultList) request.getInstrumentAccountCodes().add(mapper.toContract(iac)); instrumentAccountCodeQueueRepository.addToSearchQue(request); return resultList; } }
InstrumentAccountCodeRepository { @Transactional public List<InstrumentAccountCode> update(List<InstrumentAccountCode> instrumentAccountCodes, RequestInfo requestInfo) { InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper(); if (persistThroughKafka != null && !persistThroughKafka.isEmpty() && persistThroughKafka.equalsIgnoreCase("yes")) { InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); request.setRequestInfo(requestInfo); request.setInstrumentAccountCodes(new ArrayList<>()); for (InstrumentAccountCode iac : instrumentAccountCodes) request.getInstrumentAccountCodes().add(mapper.toContract(iac)); instrumentAccountCodeQueueRepository.addToQue(request); return instrumentAccountCodes; } else { List<InstrumentAccountCode> resultList = new ArrayList<InstrumentAccountCode>(); for (InstrumentAccountCode iac : instrumentAccountCodes) resultList.add(update(iac)); InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); request.setRequestInfo(requestInfo); request.setInstrumentAccountCodes(new ArrayList<>()); for (InstrumentAccountCode iac : resultList) request.getInstrumentAccountCodes().add(mapper.toContract(iac)); instrumentAccountCodeQueueRepository.addToSearchQue(request); return resultList; } } }
InstrumentAccountCodeRepository { @Transactional public List<InstrumentAccountCode> update(List<InstrumentAccountCode> instrumentAccountCodes, RequestInfo requestInfo) { InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper(); if (persistThroughKafka != null && !persistThroughKafka.isEmpty() && persistThroughKafka.equalsIgnoreCase("yes")) { InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); request.setRequestInfo(requestInfo); request.setInstrumentAccountCodes(new ArrayList<>()); for (InstrumentAccountCode iac : instrumentAccountCodes) request.getInstrumentAccountCodes().add(mapper.toContract(iac)); instrumentAccountCodeQueueRepository.addToQue(request); return instrumentAccountCodes; } else { List<InstrumentAccountCode> resultList = new ArrayList<InstrumentAccountCode>(); for (InstrumentAccountCode iac : instrumentAccountCodes) resultList.add(update(iac)); InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); request.setRequestInfo(requestInfo); request.setInstrumentAccountCodes(new ArrayList<>()); for (InstrumentAccountCode iac : resultList) request.getInstrumentAccountCodes().add(mapper.toContract(iac)); instrumentAccountCodeQueueRepository.addToSearchQue(request); return resultList; } } @Autowired  InstrumentAccountCodeRepository(InstrumentAccountCodeJdbcRepository instrumentAccountCodeJdbcRepository,
            InstrumentAccountCodeQueueRepository instrumentAccountCodeQueueRepository,
            @Value("${persist.through.kafka}") String persistThroughKafka,
            InstrumentAccountCodeESRepository instrumentAccountCodeESRepository,
            FinancialConfigurationContractRepository financialConfigurationContractRepository); }
InstrumentAccountCodeRepository { @Transactional public List<InstrumentAccountCode> update(List<InstrumentAccountCode> instrumentAccountCodes, RequestInfo requestInfo) { InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper(); if (persistThroughKafka != null && !persistThroughKafka.isEmpty() && persistThroughKafka.equalsIgnoreCase("yes")) { InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); request.setRequestInfo(requestInfo); request.setInstrumentAccountCodes(new ArrayList<>()); for (InstrumentAccountCode iac : instrumentAccountCodes) request.getInstrumentAccountCodes().add(mapper.toContract(iac)); instrumentAccountCodeQueueRepository.addToQue(request); return instrumentAccountCodes; } else { List<InstrumentAccountCode> resultList = new ArrayList<InstrumentAccountCode>(); for (InstrumentAccountCode iac : instrumentAccountCodes) resultList.add(update(iac)); InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); request.setRequestInfo(requestInfo); request.setInstrumentAccountCodes(new ArrayList<>()); for (InstrumentAccountCode iac : resultList) request.getInstrumentAccountCodes().add(mapper.toContract(iac)); instrumentAccountCodeQueueRepository.addToSearchQue(request); return resultList; } } @Autowired  InstrumentAccountCodeRepository(InstrumentAccountCodeJdbcRepository instrumentAccountCodeJdbcRepository,
            InstrumentAccountCodeQueueRepository instrumentAccountCodeQueueRepository,
            @Value("${persist.through.kafka}") String persistThroughKafka,
            InstrumentAccountCodeESRepository instrumentAccountCodeESRepository,
            FinancialConfigurationContractRepository financialConfigurationContractRepository); InstrumentAccountCode findById(InstrumentAccountCode instrumentAccountCode); @Transactional List<InstrumentAccountCode> save(List<InstrumentAccountCode> instrumentAccountCodes,
            RequestInfo requestInfo); @Transactional List<InstrumentAccountCode> update(List<InstrumentAccountCode> instrumentAccountCodes,
            RequestInfo requestInfo); @Transactional List<InstrumentAccountCode> delete(List<InstrumentAccountCode> instrumentAccountCodes,
            RequestInfo requestInfo); @Transactional InstrumentAccountCode save(InstrumentAccountCode instrumentAccountCode); @Transactional InstrumentAccountCode update(InstrumentAccountCode instrumentAccountCode); @Transactional InstrumentAccountCode delete(InstrumentAccountCode instrumentAccountCode); Pagination<InstrumentAccountCode> search(InstrumentAccountCodeSearch domain); boolean uniqueCheck(String fieldName, InstrumentAccountCode instrumentAccountCode); }
InstrumentAccountCodeRepository { @Transactional public List<InstrumentAccountCode> update(List<InstrumentAccountCode> instrumentAccountCodes, RequestInfo requestInfo) { InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper(); if (persistThroughKafka != null && !persistThroughKafka.isEmpty() && persistThroughKafka.equalsIgnoreCase("yes")) { InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); request.setRequestInfo(requestInfo); request.setInstrumentAccountCodes(new ArrayList<>()); for (InstrumentAccountCode iac : instrumentAccountCodes) request.getInstrumentAccountCodes().add(mapper.toContract(iac)); instrumentAccountCodeQueueRepository.addToQue(request); return instrumentAccountCodes; } else { List<InstrumentAccountCode> resultList = new ArrayList<InstrumentAccountCode>(); for (InstrumentAccountCode iac : instrumentAccountCodes) resultList.add(update(iac)); InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); request.setRequestInfo(requestInfo); request.setInstrumentAccountCodes(new ArrayList<>()); for (InstrumentAccountCode iac : resultList) request.getInstrumentAccountCodes().add(mapper.toContract(iac)); instrumentAccountCodeQueueRepository.addToSearchQue(request); return resultList; } } @Autowired  InstrumentAccountCodeRepository(InstrumentAccountCodeJdbcRepository instrumentAccountCodeJdbcRepository,
            InstrumentAccountCodeQueueRepository instrumentAccountCodeQueueRepository,
            @Value("${persist.through.kafka}") String persistThroughKafka,
            InstrumentAccountCodeESRepository instrumentAccountCodeESRepository,
            FinancialConfigurationContractRepository financialConfigurationContractRepository); InstrumentAccountCode findById(InstrumentAccountCode instrumentAccountCode); @Transactional List<InstrumentAccountCode> save(List<InstrumentAccountCode> instrumentAccountCodes,
            RequestInfo requestInfo); @Transactional List<InstrumentAccountCode> update(List<InstrumentAccountCode> instrumentAccountCodes,
            RequestInfo requestInfo); @Transactional List<InstrumentAccountCode> delete(List<InstrumentAccountCode> instrumentAccountCodes,
            RequestInfo requestInfo); @Transactional InstrumentAccountCode save(InstrumentAccountCode instrumentAccountCode); @Transactional InstrumentAccountCode update(InstrumentAccountCode instrumentAccountCode); @Transactional InstrumentAccountCode delete(InstrumentAccountCode instrumentAccountCode); Pagination<InstrumentAccountCode> search(InstrumentAccountCodeSearch domain); boolean uniqueCheck(String fieldName, InstrumentAccountCode instrumentAccountCode);  }