Skip to content

Commit

Permalink
Added an end to end test for fetching patient's active drug orders - …
Browse files Browse the repository at this point in the history
…TRUNK-4132
  • Loading branch information
wluyima committed Feb 6, 2014
1 parent 11e0a76 commit f88def2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/src/test/java/org/openmrs/OrderEntryIntegrationTest.java
Expand Up @@ -44,6 +44,15 @@ public class OrderEntryIntegrationTest extends BaseContextSensitiveTest {
@Autowired
private ConceptService conceptService;

@Test
public void shouldGetTheActiveDrugOrdersForAPatient() {
Patient patient = patientService.getPatient(2);
List<DrugOrder> activeDrugOrders = orderService.getActiveOrders(patient, DrugOrder.class, null, null);
assertEquals(2, activeDrugOrders.size());
DrugOrder[] expectedDrugOrders = { (DrugOrder) orderService.getOrder(3), (DrugOrder) orderService.getOrder(3) };
assertThat(activeDrugOrders, hasItems(expectedDrugOrders));
}

@Test
public void shouldPlaceADrugOrder() throws Exception {
executeDataSet(ORDER_ENTRY_DATASET_XML);
Expand Down

0 comments on commit f88def2

Please sign in to comment.