Browse Source

fix unit test

chensc 8 năm trước cách đây
mục cha
commit
cc955da563

+ 5 - 0
mooctest-site-server/src/test/java/cn/iselab/mooctest/site/web/logic/impl/ExamLogicImplTest.java

@@ -5,6 +5,7 @@ import cn.iselab.mooctest.site.data.CaseBlock;
 import cn.iselab.mooctest.site.models.ExamGroupUser;
 import cn.iselab.mooctest.site.models.Group;
 import cn.iselab.mooctest.site.models.Task;
+import cn.iselab.mooctest.site.service.ExamSchedulerService;
 import cn.iselab.mooctest.site.service.ExamService;
 import cn.iselab.mooctest.site.service.GroupService;
 import cn.iselab.mooctest.site.service.TaskService;
@@ -54,6 +55,9 @@ public class ExamLogicImplTest {
     @Mock
     private TaskService taskService;
     @Mock
+    private ExamSchedulerService examSchedulerService;
+
+    @Mock
     private ExamVOWrapper examVOWrapper;
     @Rule
     public ExpectedException thrown= ExpectedException.none();
@@ -239,6 +243,7 @@ public class ExamLogicImplTest {
         when(groupService.getGroupsByOwnerId(1L)).thenReturn(groups);
         when(examVOWrapper.unwrap(exam)).thenReturn(task);
         when(taskService.getCaseBlocks(123L)).thenReturn(caseBlocks);
+        when(examSchedulerService.cancelExamScheduler(task)).thenReturn(true);
         //action
         examLogic.createExam(exam);
         //assert