@Test public void getDoctorTest() throws Exception { final Query query = createMockQuery(); configureQueryMethods(query); Mockito.when(query.getResultList()).thenReturn(Arrays.asList(doctor)); final DoctorDaoResult result = doctorDao.getByTckn(doctor.getTckn()); assertTrue(result.isSuccess()); assertEquals(doctor, result.getDoctor()); verifyGet(query); }
public DoctorDaoResult getByTckn(final Long tckn) { final Query query = em.createQuery(JQL_GET_BY_TCKN); query.setParameter(Doctor.TCKN, tckn); final DoctorDaoResult result = new DoctorDaoResult(); final List resultList = query.getResultList(); getSingleResult(result, resultList); return result; }
DoctorDaoImpl implements DoctorDao { public DoctorDaoResult getByTckn(final Long tckn) { final Query query = em.createQuery(JQL_GET_BY_TCKN); query.setParameter(Doctor.TCKN, tckn); final DoctorDaoResult result = new DoctorDaoResult(); final List resultList = query.getResultList(); getSingleResult(result, resultList); return result; } }
DoctorDaoImpl implements DoctorDao { public DoctorDaoResult getByTckn(final Long tckn) { final Query query = em.createQuery(JQL_GET_BY_TCKN); query.setParameter(Doctor.TCKN, tckn); final DoctorDaoResult result = new DoctorDaoResult(); final List resultList = query.getResultList(); getSingleResult(result, resultList); return result; }  }
DoctorDaoImpl implements DoctorDao { public DoctorDaoResult getByTckn(final Long tckn) { final Query query = em.createQuery(JQL_GET_BY_TCKN); query.setParameter(Doctor.TCKN, tckn); final DoctorDaoResult result = new DoctorDaoResult(); final List resultList = query.getResultList(); getSingleResult(result, resultList); return result; }  DoctorDaoResult add(final Doctor doctor); DoctorDaoResult delete(final Doctor doctor); List<Doctor> find(final DoctorBrowseFilter filter); DoctorDaoResult getById(final Long id); DoctorDaoResult getByTckn(final Long tckn); @PersistenceContext void setEntityManager(final EntityManager em); DoctorDaoResult update(final Doctor doctor); DoctorDaoResult getByApi(final String apiKey); }
DoctorDaoImpl implements DoctorDao { public DoctorDaoResult getByTckn(final Long tckn) { final Query query = em.createQuery(JQL_GET_BY_TCKN); query.setParameter(Doctor.TCKN, tckn); final DoctorDaoResult result = new DoctorDaoResult(); final List resultList = query.getResultList(); getSingleResult(result, resultList); return result; }  DoctorDaoResult add(final Doctor doctor); DoctorDaoResult delete(final Doctor doctor); List<Doctor> find(final DoctorBrowseFilter filter); DoctorDaoResult getById(final Long id); DoctorDaoResult getByTckn(final Long tckn); @PersistenceContext void setEntityManager(final EntityManager em); DoctorDaoResult update(final Doctor doctor); DoctorDaoResult getByApi(final String apiKey);  }