限制编辑亲属证件信息变更
This commit is contained in:
@@ -116,6 +116,30 @@ class CcdiStaffFmyRelationServiceImplTest {
|
||||
verify(assetInfoService, never()).replaceByFamilyIdAndPersonId(any(), any(), any());
|
||||
}
|
||||
|
||||
@Test
|
||||
void updateRelation_shouldRejectRelationCertNoChange() {
|
||||
CcdiStaffFmyRelation existing = new CcdiStaffFmyRelation();
|
||||
existing.setId(10L);
|
||||
existing.setRelationCertType("护照");
|
||||
existing.setRelationCertNo("A123456789");
|
||||
|
||||
CcdiStaffFmyRelationEditDTO editDTO = new CcdiStaffFmyRelationEditDTO();
|
||||
editDTO.setId(10L);
|
||||
editDTO.setPersonId("320101199001010011");
|
||||
editDTO.setRelationType("配偶");
|
||||
editDTO.setRelationName("李四");
|
||||
editDTO.setRelationCertType("护照");
|
||||
editDTO.setRelationCertNo("B987654321");
|
||||
|
||||
when(relationMapper.selectById(10L)).thenReturn(existing);
|
||||
|
||||
RuntimeException exception = assertThrows(RuntimeException.class, () -> service.updateRelation(editDTO));
|
||||
|
||||
assertEquals("关系人证件类型/证件号码不允许修改", exception.getMessage());
|
||||
verify(relationMapper, never()).updateById(any(CcdiStaffFmyRelation.class));
|
||||
verify(assetInfoService, never()).replaceByFamilyIdAndPersonId(any(), any(), any());
|
||||
}
|
||||
|
||||
@Test
|
||||
void updateRelation_shouldReplaceAssetsByOwnershipKey() {
|
||||
CcdiStaffFmyRelation existing = new CcdiStaffFmyRelation();
|
||||
|
||||
Reference in New Issue
Block a user