@Test public void shouldCreateTaxPeriods() { List<TaxPeriod> taxPeriodsForRequest = new ArrayList<>(); taxPeriodsForRequest.add(getTaxPeriod()); TaxPeriodRequest taxPeriodRequest = new TaxPeriodRequest(); taxPeriodRequest.setTaxPeriods(taxPeriodsForRequest); List<TaxPeriod> taxPeriodsForResponse = new ArrayList<>(); taxPeriodsForResponse.add(getTaxPeriod()); TaxPeriodResponse taxPeriodResponse = new TaxPeriodResponse(); taxPeriodResponse.setResponseInfo(null); taxPeriodResponse.setTaxPeriods(taxPeriodsForResponse); when(taxPeriodRepository.create(any(TaxPeriodRequest.class))).thenReturn(taxPeriodsForRequest); assertTrue(taxPeriodResponse.equals(taxPeriodService.create(taxPeriodRequest))); }
public TaxPeriodResponse create(TaxPeriodRequest taxPeriodRequest) { List<TaxPeriod> taxPeriodList = taxPeriodRepository.create(taxPeriodRequest); return getTaxPeriodResponse(taxPeriodList, taxPeriodRequest.getRequestInfo()); }
TaxPeriodService { public TaxPeriodResponse create(TaxPeriodRequest taxPeriodRequest) { List<TaxPeriod> taxPeriodList = taxPeriodRepository.create(taxPeriodRequest); return getTaxPeriodResponse(taxPeriodList, taxPeriodRequest.getRequestInfo()); } }
TaxPeriodService { public TaxPeriodResponse create(TaxPeriodRequest taxPeriodRequest) { List<TaxPeriod> taxPeriodList = taxPeriodRepository.create(taxPeriodRequest); return getTaxPeriodResponse(taxPeriodList, taxPeriodRequest.getRequestInfo()); }  }
TaxPeriodService { public TaxPeriodResponse create(TaxPeriodRequest taxPeriodRequest) { List<TaxPeriod> taxPeriodList = taxPeriodRepository.create(taxPeriodRequest); return getTaxPeriodResponse(taxPeriodList, taxPeriodRequest.getRequestInfo()); }  TaxPeriodResponse searchTaxPeriods(final TaxPeriodCriteria taxPeriodCriteria, final RequestInfo requestInfo); TaxPeriodResponse create(TaxPeriodRequest taxPeriodRequest); TaxPeriodResponse createAsync(TaxPeriodRequest taxPeriodRequest); TaxPeriodResponse updateAsync(TaxPeriodRequest taxPeriodRequest); TaxPeriodResponse update(TaxPeriodRequest taxPeriodRequest); }
TaxPeriodService { public TaxPeriodResponse create(TaxPeriodRequest taxPeriodRequest) { List<TaxPeriod> taxPeriodList = taxPeriodRepository.create(taxPeriodRequest); return getTaxPeriodResponse(taxPeriodList, taxPeriodRequest.getRequestInfo()); }  TaxPeriodResponse searchTaxPeriods(final TaxPeriodCriteria taxPeriodCriteria, final RequestInfo requestInfo); TaxPeriodResponse create(TaxPeriodRequest taxPeriodRequest); TaxPeriodResponse createAsync(TaxPeriodRequest taxPeriodRequest); TaxPeriodResponse updateAsync(TaxPeriodRequest taxPeriodRequest); TaxPeriodResponse update(TaxPeriodRequest taxPeriodRequest); static final Logger LOGGER; }