测试考勤:覆盖首次签到与未签到展示

This commit is contained in:
wangzhibiao committed 2026-09-21 23:21:35 +08:00
1 parent dfd0133df0
commit 38d4851a18
3 files changed
+336

No files matched your search

@@ -6,6 +6,7 @@ import static org.junit.Assert.assertNotNull;
import java.lang.reflect.Method;
import org.junit.Test;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import com.ruoyi.train.domain.dto.AttendanceAdjustDTO;
@@ -56,5 +57,13 @@ public class AttendanceAndReportApiControllerContractTest
assertNotNull(putAdjust);
assertEquals("/{checkinId}", putAdjust.value()[0]);
assertEquals("@ss.hasPermi('train:attendance:edit')", adjust.getAnnotation(PreAuthorize.class).value());
// 4. 课次学员考勤名册 (纯只读,供管理员点名签到)
Method getRoster = AttendanceController.class.getMethod("getLessonRoster", Long.class);
assertNotNull(getRoster);
GetMapping getRosterAnnotation = getRoster.getAnnotation(GetMapping.class);
assertNotNull(getRosterAnnotation);
assertEquals("/lessons/{lessonId}/roster", getRosterAnnotation.value()[0]);
assertEquals("@ss.hasPermi('train:attendance:list')", getRoster.getAnnotation(PreAuthorize.class).value());
}
}