@Test public void create() throws Exception { Bill bill = BillFactory.createBill(1002, 5000.00, new Date()); billList.add(bill); Patient patient = new Patient.Builder(7811) .firstName("Chantell") .lastName("Witbooi") .age(52) .occupation("slave") .bill(billList) .build(); repository.save(patient); id = patient.getId(); billId = bill.getId(); Assert.assertNotNull(patient.getId()); }
@Test(dependsOnMethods = "create") public void read() throws Exception { Patient patient = repository.findOne(id); Assert.assertEquals(52, patient.getAge()); }