Skip to content

Commit

Permalink
Back porting to 1.9.x the unit test for: Error when adding a task in
Browse files Browse the repository at this point in the history
version 1.9.3 - TRUNK-3970
  • Loading branch information
dkayiwa committed Jun 27, 2013
1 parent 4ceecfb commit 140dd61
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -30,6 +30,7 @@
import org.openmrs.scheduler.TaskDefinition;
import org.openmrs.test.Verifies;
import org.openmrs.web.test.BaseWebContextSensitiveTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.validation.BindException;
Expand All @@ -42,6 +43,9 @@ public class SchedulerFormControllerTest extends BaseWebContextSensitiveTest {

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

@Autowired
private SchedulerFormController controller;

/**
* @see {@link SchedulerFormController#onSubmit(HttpServletRequest,HttpServletResponse,Object,BindException)}
*/
Expand Down Expand Up @@ -181,4 +185,15 @@ public void onSubmit_shouldNotRescheduleATaskIfTheStartTimeHasPassed() throws Ex
Assert.assertFalse(task.getStarted());
}
}

/**
* See TRUNK-3970: Error when adding a task in version 1.9.3
* https://tickets.openmrs.org/browse/TRUNK-3970
*/
@Test
public void addANewTaskShouldNotError() throws Exception {
HttpServletRequest request = new MockHttpServletRequest("GET", "/openmrs/admin/scheduler/scheduler.form");
ModelAndView mav = controller.handleRequest(request, new MockHttpServletResponse());
assertNotNull(mav);
}
}

0 comments on commit 140dd61

Please sign in to comment.