|
|
@@ -42,6 +42,7 @@ class TrainCertApproveBoundaryContractTest {
|
|
|
private static final int CODE_OK = 200;
|
|
|
private static final int CODE_SAME_KEY_DIFF_PAYLOAD = 4092;
|
|
|
private static final int CODE_FORBIDDEN = 403;
|
|
|
+ private static final int CODE_NOT_FOUND = 404;
|
|
|
|
|
|
private static final Long ADMIN_A = 1L;
|
|
|
private static final Long ADMIN_B = 2L;
|
|
|
@@ -118,4 +119,18 @@ class TrainCertApproveBoundaryContractTest {
|
|
|
"同键同载荷重放须显式标识 replay=true,供调用方区分首次审批与幂等回放");
|
|
|
verify(profileMapper, times(1)).updateById(any(TrainPractitionerProfile.class));
|
|
|
}
|
|
|
+
|
|
|
+ /** C404 边界补强:软删除(deleted=1)档案须按不存在处理,不得静默审批通过。 */
|
|
|
+ @Test
|
|
|
+ void deletedProfileReturns404() {
|
|
|
+ TrainPractitionerProfile p = pendingProfile();
|
|
|
+ p.setDeleted(1);
|
|
|
+ when(profileMapper.selectOne(any())).thenReturn(p);
|
|
|
+
|
|
|
+ Result<Map<String, Object>> r = service.approveProfile(ADMIN_A, Boolean.TRUE, TARGET_USER_ID);
|
|
|
+
|
|
|
+ assertEquals(CODE_NOT_FOUND, r.getCode(),
|
|
|
+ "软删除(deleted=1)的待审批档案须按不存在处理返回 C404(404),不得静默审批通过;"
|
|
|
+ + "当前 code=" + r.getCode());
|
|
|
+ }
|
|
|
}
|