diff --git a/api/src/main/java/org/openmrs/module/appointmentscheduling/api/impl/AppointmentServiceImpl.java b/api/src/main/java/org/openmrs/module/appointmentscheduling/api/impl/AppointmentServiceImpl.java index 9f7187a6..55fe2fb2 100644 --- a/api/src/main/java/org/openmrs/module/appointmentscheduling/api/impl/AppointmentServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/appointmentscheduling/api/impl/AppointmentServiceImpl.java @@ -958,7 +958,7 @@ public List getDailyAppointmentBlocks(Location locati @Override public List getDailyAppointmentBlocks(Location location, Date date, List appointmentTypes) { - + List scheduledAppointmentBlockList = new ArrayList(); for (AppointmentBlock appointmentBlock : getAppointmentBlockList(location, date, appointmentTypes)) { diff --git a/api/src/test/java/org/openmrs/module/appointmentscheduling/api/AppointmentServiceTest.java b/api/src/test/java/org/openmrs/module/appointmentscheduling/api/AppointmentServiceTest.java index 5a69f5f4..a3f4ef3b 100644 --- a/api/src/test/java/org/openmrs/module/appointmentscheduling/api/AppointmentServiceTest.java +++ b/api/src/test/java/org/openmrs/module/appointmentscheduling/api/AppointmentServiceTest.java @@ -494,24 +494,24 @@ public void shouldReturnDailyAppointmentsWithoutProviderAssigned() throws Except List appointmentList = scheduledAppointmentBlockList.get(0).getAppointments(); assertEquals(1, appointmentList.size()); } - - @Test - public void shouldReturnDailyAppointmentsWhenMultipleAppointmentTypesChosen() throws Exception { - - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S"); - Date date = format.parse("2014-01-02 00:00:00.0"); - - Location location = Context.getLocationService().getLocation(3); - - AppointmentType appointmentType2 = service.getAppointmentType(3); - AppointmentType appointmentType3 = service.getAppointmentType(1); - - List scheduledAppointmentBlockList = service.getDailyAppointmentBlocks(location, date, - Arrays.asList(appointmentType2, appointmentType3)); - - assertEquals(1, scheduledAppointmentBlockList.size()); - assertEquals(new Integer(5), scheduledAppointmentBlockList.get(0).getId()); - } + + @Test + public void shouldReturnDailyAppointmentsWhenMultipleAppointmentTypesChosen() throws Exception { + + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S"); + Date date = format.parse("2014-01-02 00:00:00.0"); + + Location location = Context.getLocationService().getLocation(3); + + AppointmentType appointmentType2 = service.getAppointmentType(3); + AppointmentType appointmentType3 = service.getAppointmentType(1); + + List scheduledAppointmentBlockList = service.getDailyAppointmentBlocks(location, date, + Arrays.asList(appointmentType2, appointmentType3)); + + assertEquals(1, scheduledAppointmentBlockList.size()); + assertEquals(new Integer(5), scheduledAppointmentBlockList.get(0).getAppointmentBlock().getId()); + } @Test @Verifies(value = "retrieve all appointments scheduled in a given time slot", method = "getAppointmentsInTimeSlot(TimeSlot)")