TaxWebserviceCallResultRepository extends AbstractRepository<TaxWebserviceCallResult> { public List<TaxWebserviceCallResult> findByTaxCalculation(TaxCalculation taxCalculation) { TypedQuery<TaxWebserviceCallResult> byTaxCalculation = entityManager.createNamedQuery(TaxWebserviceCallResult.FIND_BY_TAXCALCULATION, TaxWebserviceCallResult.class); byTaxCalculation.setParameter("taxCalculationId", taxCalculation.getId()); return byTaxCalculation.getResultList(); }  List<TaxWebserviceCallResult> findByTaxCalculation(TaxCalculation taxCalculation); TaxWebserviceCallResult findSuccessfulByTaxCalculation(TaxCalculation taxCalculation);  }
@Test public void testFindByTaxCalculation() { List<TaxWebserviceCallResult> forJanuary = taxWebserviceCallResultRepository.findByTaxCalculation(january); List<TaxWebserviceCallResult> forFebruary = taxWebserviceCallResultRepository.findByTaxCalculation(february); assertThat(forJanuary).containsOnly(januaryTry1, januaryTry2); assertThat(forFebruary).containsOnly(februaryTry1); }