@Test public void testAdd() { Mockito.doNothing().when(tradeLicenseQueueRepository).add(Mockito.any()); TradeLicenseRequest request = new TradeLicenseRequest(); request.setRequestInfo(getRequestInfo()); request.setLicenses(new ArrayList<TradeLicenseContract>()); request.getLicenses().add(getTradeLicenseContract()); tradeLicenseRepository.add(request, true); Mockito.verify(tradeLicenseQueueRepository).add(request); }
public void add(TradeLicenseRequest request, Boolean isNewRecord) { if (request != null && request.getLicenses() != null && request.getLicenses().size() > 0) { if (isNewRecord) { if (request.getLicenses().get(0).getIsLegacy()) { request.getRequestInfo().setAction("legacy-create"); } else { request.getRequestInfo().setAction("new-create"); } } else { if (request.getLicenses().get(0).getIsLegacy()) { request.getRequestInfo().setAction("legacy-update"); } else { request.getRequestInfo().setAction("new-update"); } } } tradeLicenseQueueRepository.add(request); }
TradeLicenseRepository { public void add(TradeLicenseRequest request, Boolean isNewRecord) { if (request != null && request.getLicenses() != null && request.getLicenses().size() > 0) { if (isNewRecord) { if (request.getLicenses().get(0).getIsLegacy()) { request.getRequestInfo().setAction("legacy-create"); } else { request.getRequestInfo().setAction("new-create"); } } else { if (request.getLicenses().get(0).getIsLegacy()) { request.getRequestInfo().setAction("legacy-update"); } else { request.getRequestInfo().setAction("new-update"); } } } tradeLicenseQueueRepository.add(request); } }
TradeLicenseRepository { public void add(TradeLicenseRequest request, Boolean isNewRecord) { if (request != null && request.getLicenses() != null && request.getLicenses().size() > 0) { if (isNewRecord) { if (request.getLicenses().get(0).getIsLegacy()) { request.getRequestInfo().setAction("legacy-create"); } else { request.getRequestInfo().setAction("new-create"); } } else { if (request.getLicenses().get(0).getIsLegacy()) { request.getRequestInfo().setAction("legacy-update"); } else { request.getRequestInfo().setAction("new-update"); } } } tradeLicenseQueueRepository.add(request); }  }
TradeLicenseRepository { public void add(TradeLicenseRequest request, Boolean isNewRecord) { if (request != null && request.getLicenses() != null && request.getLicenses().size() > 0) { if (isNewRecord) { if (request.getLicenses().get(0).getIsLegacy()) { request.getRequestInfo().setAction("legacy-create"); } else { request.getRequestInfo().setAction("new-create"); } } else { if (request.getLicenses().get(0).getIsLegacy()) { request.getRequestInfo().setAction("legacy-update"); } else { request.getRequestInfo().setAction("new-update"); } } } tradeLicenseQueueRepository.add(request); }  Long getNextSequence(); Boolean uniqueCheck(String fieldName, TradeLicense tradeLicense); Boolean idExistenceCheck(TradeLicense tradeLicense); void add(TradeLicenseRequest request, Boolean isNewRecord); @Transactional TradeLicense save(TradeLicense tradeLicense); @Transactional TradeLicense update(TradeLicense tradeLicense); TradeLicense findLicense(LicenseSearch domain); @Transactional List<TradeLicense> search(LicenseSearch domain); @Transactional void createLicenseBill(LicenseBill licenseBill); @Transactional void updateTradeLicenseAfterWorkFlowQuery(String consumerCode, String status); Long getLicenseBillId(Long licenseId); Long getApplicationBillId(Long licenseId); }
TradeLicenseRepository { public void add(TradeLicenseRequest request, Boolean isNewRecord) { if (request != null && request.getLicenses() != null && request.getLicenses().size() > 0) { if (isNewRecord) { if (request.getLicenses().get(0).getIsLegacy()) { request.getRequestInfo().setAction("legacy-create"); } else { request.getRequestInfo().setAction("new-create"); } } else { if (request.getLicenses().get(0).getIsLegacy()) { request.getRequestInfo().setAction("legacy-update"); } else { request.getRequestInfo().setAction("new-update"); } } } tradeLicenseQueueRepository.add(request); }  Long getNextSequence(); Boolean uniqueCheck(String fieldName, TradeLicense tradeLicense); Boolean idExistenceCheck(TradeLicense tradeLicense); void add(TradeLicenseRequest request, Boolean isNewRecord); @Transactional TradeLicense save(TradeLicense tradeLicense); @Transactional TradeLicense update(TradeLicense tradeLicense); TradeLicense findLicense(LicenseSearch domain); @Transactional List<TradeLicense> search(LicenseSearch domain); @Transactional void createLicenseBill(LicenseBill licenseBill); @Transactional void updateTradeLicenseAfterWorkFlowQuery(String consumerCode, String status); Long getLicenseBillId(Long licenseId); Long getApplicationBillId(Long licenseId);  }