Skip to content

Commit

Permalink
Follow up to fix more tests in OrderEntryIntegrationTest and OrderTes…
Browse files Browse the repository at this point in the history
…t - TRUNK-4202
  • Loading branch information
wluyima committed Feb 6, 2014
1 parent 21026f4 commit ed1d9dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions api/src/test/java/org/openmrs/OrderEntryIntegrationTest.java
Expand Up @@ -46,7 +46,7 @@ public class OrderEntryIntegrationTest extends BaseContextSensitiveTest {

@Autowired
private ConceptService conceptService;

@Test
public void shouldGetTheActiveOrdersForAPatient() {
Patient patient = patientService.getPatient(2);
Expand Down Expand Up @@ -138,20 +138,19 @@ public void shouldDiscontinueAnActiveOrder() throws Exception {
Order secondOrderToDiscontinue = orderService.getOrder(5);
assertEquals(patient, secondOrderToDiscontinue.getPatient());
assertTrue(OrderUtil.isOrderActive(secondOrderToDiscontinue, null));
Order discontinuationOrder2 = orderService.discontinueOrder(secondOrderToDiscontinue, "Testing", null);
assertEquals(secondOrderToDiscontinue, discontinuationOrder2.getPreviousOrder());

//Lets discontinue another order by saving a DC order
Order thirdOrderToDiscontinue = orderService.getOrder(7);
assertTrue(OrderUtil.isOrderActive(thirdOrderToDiscontinue, null));
Order discontinuationOrder = thirdOrderToDiscontinue.cloneForDiscontinuing();
orderService.saveOrder(discontinuationOrder);

Order discontinuationOrder2 = orderService.discontinueOrder(secondOrderToDiscontinue, "Testing", null);
assertEquals(secondOrderToDiscontinue, discontinuationOrder2.getPreviousOrder());

List<Order> activeOrders = orderService.getActiveOrders(patient, null, null, null);
assertEquals(ordersCount - 3, activeOrders.size());
assertFalse(activeOrders.contains(firstOrderToDiscontinue));
assertFalse(activeOrders.contains(secondOrderToDiscontinue));
assertFalse(activeOrders.contains(thirdOrderToDiscontinue));
assertFalse(activeOrders.contains(thirdOrderToDiscontinue));
}
}
1 change: 0 additions & 1 deletion api/src/test/java/org/openmrs/OrderTest.java
Expand Up @@ -104,7 +104,6 @@ public void cloneForDiscontinuing_shouldSetAllTheRelevantFields() throws Excepti
anOrder.setPatient(new Patient());
anOrder.setCareSetting(new CareSetting());
anOrder.setConcept(new Concept());
anOrder.setUuid(UUID.randomUUID().toString());

Order orderThatCanDiscontinueTheOrder = anOrder.cloneForDiscontinuing();

Expand Down

0 comments on commit ed1d9dc

Please sign in to comment.