Skip to content

Instantly share code, notes, and snippets.

@mks-d
Created March 22, 2018 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mks-d/6f7923f1c654f51704a7ff353ad1cece to your computer and use it in GitHub Desktop.
Save mks-d/6f7923f1c654f51704a7ff353ad1cece to your computer and use it in GitHub Desktop.
package org.openmrs.module.attachments;
import java.util.List;
import org.junit.Test;
import org.openmrs.Encounter;
import org.openmrs.Patient;
import org.openmrs.Visit;
import org.openmrs.api.EncounterService;
import org.openmrs.api.PatientService;
import org.openmrs.api.VisitService;
import org.openmrs.module.attachments.obs.Attachment;
import org.springframework.beans.factory.annotation.Autowired;
public class AttachmentsServiceTest {
@Autowired
private AttachmentsService as;
@Autowired
private PatientService ps;
@Autowired
private VisitService vs;
@Autowired
private EncounterService es;
@Test
public void getAttachments_shouldReturnAttachments() {
// Setup
Patient patient = ps.getPatient(2);
Visit activeVisit = vs.getActiveVisitsByPatient(patient).get(0);
Encounter encounter = es.getEncountersByPatient(patient).get(0);
List<Attachment> attachmentList = as.getAttachments(patient, activeVisit, encounter, true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment