yangyichao-mango commented on pull request #3053:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/3053#issuecomment-650669527


   > > Hi @dailidong .
   > > When I want to add the unit test case in 
`ProcessDefinitionControllerTest`, I found the 
`ProcessDefinitionControllerTest` is ran with the `MockitoJUnitRunner` but not 
the `SpringRunner` like the other controller test cases. I checked the history 
log and found @zixi0825 changed it from `SpringRunner` to `MockitoJUnitRunner` 
in `ProcessDefinitionControllerTest`.
   > > Hi @zixi0825 , can you help me to understand why changed `SpringRunner` 
to `MockitoJUnitRunner`, Thx a lot.
   > 
   > MockitoJUnitRunner is used to simulate spring injection objects.
   > like this : 
Mockito.when(projectMapper.queryByName(projectName)).thenReturn(getProject(projectName));
   
   Hi @zixi0825 , thx a lot for your answer.
   What I actually want to know is why we need to change the 
`ProcessDefinitionControllerTest` test component from `SpringRunner` to 
`MockitoJUnitRunner`. Is it necessary for us to keep all the ApiTestCase 
consistent(Replace to MockitoJUnitRunner or SpringRunner)?
   
   非常感谢你的回答。
   但是我想了解的是之前是有什么场景需要我们把`ProcessDefinitionControllerTest` 的测试组件从`SpringRunner` 
换为`MockitoJUnitRunner` 吗?
   我们是否有必要将api层所有的测试框架统一(全部换为MockitoJUnitRunner或者SpringRunner)?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to