Skip to content

Commit 140dd61

Browse files
committedJun 27, 2013
Back porting to 1.9.x the unit test for: Error when adding a task in
version 1.9.3 - TRUNK-3970
1 parent 4ceecfb commit 140dd61

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎web/src/test/java/org/openmrs/scheduler/web/controller/SchedulerFormControllerTest.java

+15
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.openmrs.scheduler.TaskDefinition;
3131
import org.openmrs.test.Verifies;
3232
import org.openmrs.web.test.BaseWebContextSensitiveTest;
33+
import org.springframework.beans.factory.annotation.Autowired;
3334
import org.springframework.mock.web.MockHttpServletRequest;
3435
import org.springframework.mock.web.MockHttpServletResponse;
3536
import org.springframework.validation.BindException;
@@ -42,6 +43,9 @@ public class SchedulerFormControllerTest extends BaseWebContextSensitiveTest {
4243

4344
private static final String INITIAL_SCHEDULER_TASK_CONFIG_XML = "org/openmrs/web/include/SchedulerServiceTest.xml";
4445

46+
@Autowired
47+
private SchedulerFormController controller;
48+
4549
/**
4650
* @see {@link SchedulerFormController#onSubmit(HttpServletRequest,HttpServletResponse,Object,BindException)}
4751
*/
@@ -181,4 +185,15 @@ public void onSubmit_shouldNotRescheduleATaskIfTheStartTimeHasPassed() throws Ex
181185
Assert.assertFalse(task.getStarted());
182186
}
183187
}
188+
189+
/**
190+
* See TRUNK-3970: Error when adding a task in version 1.9.3
191+
* https://tickets.openmrs.org/browse/TRUNK-3970
192+
*/
193+
@Test
194+
public void addANewTaskShouldNotError() throws Exception {
195+
HttpServletRequest request = new MockHttpServletRequest("GET", "/openmrs/admin/scheduler/scheduler.form");
196+
ModelAndView mav = controller.handleRequest(request, new MockHttpServletResponse());
197+
assertNotNull(mav);
198+
}
184199
}

0 commit comments

Comments
 (0)
Please sign in to comment.