@Test public void testGetTaxesByShopCode() throws Exception { final TaxService taxService = ctx().getBean("taxService", TaxService.class); final List<Long> expectedEur = Arrays.asList(1010L, 1011L, 1012L, 1013L, 1014L, 1015L, 1016L); final List<Tax> eurTaxes = taxService.getTaxesByShopCode("SHOIP1", "EUR"); assertFalse(eurTaxes.isEmpty()); assertEquals(7, eurTaxes.size()); for (final Tax tax : eurTaxes) { assertTrue(expectedEur.contains(tax.getTaxId())); } final List<Long> expectedUsd = Collections.singletonList(1020L); final List<Tax> usdTaxes = taxService.getTaxesByShopCode("SHOIP1", "USD"); assertFalse(usdTaxes.isEmpty()); assertEquals(1, usdTaxes.size()); for (final Tax tax : usdTaxes) { assertTrue(expectedUsd.contains(tax.getTaxId())); } final List<Long> expectedUah = Collections.singletonList(1030L); final List<Tax> uahTaxes = taxService.getTaxesByShopCode("SHOIP1", "UAH"); assertFalse(uahTaxes.isEmpty()); assertEquals(1, uahTaxes.size()); for (final Tax tax : uahTaxes) { assertTrue(expectedUah.contains(tax.getTaxId())); } }
@Override public List<Tax> getTaxesByShopCode(final String shopCode, final String currency) { return getGenericDao().findByNamedQuery("TAX.BY.SHOPCODE.CURRENCY", shopCode, currency); }
TaxServiceImpl extends BaseGenericServiceImpl<Tax> implements TaxService { @Override public List<Tax> getTaxesByShopCode(final String shopCode, final String currency) { return getGenericDao().findByNamedQuery("TAX.BY.SHOPCODE.CURRENCY", shopCode, currency); } }
TaxServiceImpl extends BaseGenericServiceImpl<Tax> implements TaxService { @Override public List<Tax> getTaxesByShopCode(final String shopCode, final String currency) { return getGenericDao().findByNamedQuery("TAX.BY.SHOPCODE.CURRENCY", shopCode, currency); } TaxServiceImpl(final GenericDAO<Tax, Long> genericDao); }
TaxServiceImpl extends BaseGenericServiceImpl<Tax> implements TaxService { @Override public List<Tax> getTaxesByShopCode(final String shopCode, final String currency) { return getGenericDao().findByNamedQuery("TAX.BY.SHOPCODE.CURRENCY", shopCode, currency); } TaxServiceImpl(final GenericDAO<Tax, Long> genericDao); @Override Tax getById(final long pk); @Override List<Tax> getTaxesByShopCode(final String shopCode, final String currency); @Override List<Tax> findTaxes(final int start, final int offset, final String sort, final boolean sortDescending, final Map<String, List> filter); @Override int findTaxCount(final Map<String, List> filter); @Override Tax create(final Tax instance); @Override Tax update(final Tax instance); @Override void delete(final Tax instance); }
TaxServiceImpl extends BaseGenericServiceImpl<Tax> implements TaxService { @Override public List<Tax> getTaxesByShopCode(final String shopCode, final String currency) { return getGenericDao().findByNamedQuery("TAX.BY.SHOPCODE.CURRENCY", shopCode, currency); } TaxServiceImpl(final GenericDAO<Tax, Long> genericDao); @Override Tax getById(final long pk); @Override List<Tax> getTaxesByShopCode(final String shopCode, final String currency); @Override List<Tax> findTaxes(final int start, final int offset, final String sort, final boolean sortDescending, final Map<String, List> filter); @Override int findTaxCount(final Map<String, List> filter); @Override Tax create(final Tax instance); @Override Tax update(final Tax instance); @Override void delete(final Tax instance);  }