/** * @verifies load objects based on the resource description * @see RestAssuredService#loadObjects(String, com.burkeware.search.api.resource.Resource) */ @Test public void loadObjects_shouldLoadObjectsBasedOnTheResourceDescription() throws Exception { Resource resource = null; resource = Context.getResource("Cohort Resource"); Assert.assertNotNull(resource); service.loadObjects(StringUtil.EMPTY, resource); List<Cohort> cohorts = service.getObjects(StringUtil.EMPTY, Cohort.class); for (Cohort cohort : cohorts) { resource = Context.getResource("Cohort Member Resource"); Assert.assertNotNull(resource); service.loadObjects(cohort.getUuid(), resource); List<Patient> patients = service.getObjects(StringUtil.EMPTY, Patient.class); for (Patient patient : patients) { resource = Context.getResource("Observation Resource"); Assert.assertNotNull(resource); service.loadObjects(patient.getUuid(), resource); } } List<Patient> patients = service.getObjects("name:A*", Patient.class); Assert.assertNotNull(patients); Assert.assertTrue(patients.size() > 0); for (Patient patient : patients) { Assert.assertNotNull(patient); Assert.assertEquals(Patient.class, patient.getClass()); } Patient patient = service.getObject("name: " + StringUtil.quote(REST_PATIENT_NAME), Patient.class); Assert.assertNotNull(patient); Assert.assertEquals(Patient.class, patient.getClass()); }