解决了全局异常处理bug
This commit is contained in:
@ -36,12 +36,11 @@ class ProjectServiceImplTest {
|
||||
CommonRequest req = new CommonRequest();
|
||||
req.setId(10L);
|
||||
when(projectService.getById(10L)).thenReturn(null);
|
||||
|
||||
// Act & Assert
|
||||
RuntimeException ex = assertThrows(RuntimeException.class, () ->
|
||||
service.queryProjectById(req)
|
||||
);
|
||||
assertTrue(ex.getMessage().contains("当前项目不存在"));
|
||||
assertTrue(ex.getMessage().equals("当前项目不存在"));
|
||||
|
||||
// commonService.copyProperties 不应被调用
|
||||
verify(commonService, never()).copyProperties(any(), any());
|
||||
|
Reference in New Issue
Block a user