@Test public void manyToManyTest() { persistSimplePOJO(); Patient patient = em.find(Patient.class, 1l); assertEquals(2, patient.getPatientsPills().size()); }
@Test public void loadTest() { persistSimplePOJO(); Patient patient = em.find(Patient.class, 1l); assertEquals("Mark", patient.getName()); }
public Patient getPatient() { Patient patient = new Patient(); patient.setDateOfBirth(new Date()); patient.setGender(Gender.MALE); patient.setName("Mark"); patient.setFamilyName("Tompson"); List<Pills> pills = new ArrayList<Pills>(); pills.add(new Pills("Vicodin")); pills.add(new Pills("Aspirin")); patient.setPatientsPills(pills); return patient; }