From 21655f79df7c46a229bb4871bc219c5c99fc73f7 Mon Sep 17 00:00:00 2001 From: Pamela Canchanya Date: Tue, 1 Apr 2014 15:36:22 -0400 Subject: [PATCH] UHM-1172 Fix appointment tests resources --- .../module/appointmentscheduling/Appointment.java | 9 +-------- .../serialize/AppointmentStatusSerializer.java | 2 +- .../api/TimeSlotServiceTest.java | 14 ++++++-------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/api/src/main/java/org/openmrs/module/appointmentscheduling/Appointment.java b/api/src/main/java/org/openmrs/module/appointmentscheduling/Appointment.java index e77d03d3..c1885501 100644 --- a/api/src/main/java/org/openmrs/module/appointmentscheduling/Appointment.java +++ b/api/src/main/java/org/openmrs/module/appointmentscheduling/Appointment.java @@ -43,6 +43,7 @@ public enum AppointmentStatus { "Cancelled", true, false), WAITING("Waiting", false, true), INCONSULTATION("In-Consultation", false, true), COMPLETED( "Completed", false, false), MISSED("Missed", false, false), CANCELLED_AND_NEEDS_RESCHEDULE( "Cancelled and Needs Reschedule", true, false); + private final String name; /** @@ -94,14 +95,6 @@ public boolean evaluate(Object o) { return ((AppointmentStatus) o).isCancelled(); } }; - - public static Predicate notCancelledPredicate = new Predicate() { - - @Override - public boolean evaluate(Object o) { - return !((AppointmentStatus) o).isCancelled(); - } - }; public static Predicate notCancelledPredicate = new Predicate() { diff --git a/api/src/main/java/org/openmrs/module/appointmentscheduling/serialize/AppointmentStatusSerializer.java b/api/src/main/java/org/openmrs/module/appointmentscheduling/serialize/AppointmentStatusSerializer.java index 3cba9c5b..629995d8 100644 --- a/api/src/main/java/org/openmrs/module/appointmentscheduling/serialize/AppointmentStatusSerializer.java +++ b/api/src/main/java/org/openmrs/module/appointmentscheduling/serialize/AppointmentStatusSerializer.java @@ -22,7 +22,7 @@ public void serialize(Appointment.AppointmentStatus appointmentStatus, JsonGener jsonGenerator.writeFieldName("active"); jsonGenerator.writeBoolean(appointmentStatus.isActive()); jsonGenerator.writeFieldName("cancelled"); - jsonGenerator.writeBoolean(appointmentStatus.isCancelled()); + jsonGenerator.writeBoolean(appointmentStatus.isActive()); jsonGenerator.writeEndObject(); } } diff --git a/api/src/test/java/org/openmrs/module/appointmentscheduling/api/TimeSlotServiceTest.java b/api/src/test/java/org/openmrs/module/appointmentscheduling/api/TimeSlotServiceTest.java index 9f6f9e1a..9beef939 100644 --- a/api/src/test/java/org/openmrs/module/appointmentscheduling/api/TimeSlotServiceTest.java +++ b/api/src/test/java/org/openmrs/module/appointmentscheduling/api/TimeSlotServiceTest.java @@ -37,11 +37,9 @@ import static org.junit.Assert.assertTrue; /** -<<<<<<< HEAD - * Tests Time Slot methods in the {@link AppointmentService} . -======= - * Tests Time Slot methods in the {@link AppointmentService} . ->>>>>>> f97b876... fixed which AppointmentStatuses are considered "cancelled" + * <<<<<<< HEAD Tests Time Slot methods in the {@link AppointmentService} . ======= Tests Time Slot + * methods in the {@link AppointmentService} . >>>>>>> f97b876... fixed which AppointmentStatuses + * are considered "cancelled" */ public class TimeSlotServiceTest extends BaseModuleContextSensitiveTest { @@ -403,9 +401,9 @@ public void shouldGetOnlyAvailableTimeSlotsByConstraintsSortedByStartDate() thro assertNotNull(result); assertEquals(4, result.size()); assertEquals(5, result.get(0).getTimeSlotId().intValue()); - assertEquals(4, result.get(1).getTimeSlotId().intValue()); - assertEquals(8, result.get(2).getTimeSlotId().intValue()); - assertEquals(9, result.get(3).getTimeSlotId().intValue()); + assertEquals(4, result.get(1).getTimeSlotId().intValue()); + assertEquals(8, result.get(2).getTimeSlotId().intValue()); + assertEquals(9, result.get(3).getTimeSlotId().intValue()); } }