Using @Mock and @InjectMocks

后端 未结 3 1439
旧巷少年郎
旧巷少年郎 2020-12-06 03:55

I\'m currently studying the Mockito framework and I\'ve created several test cases using Mockito. But then I read that instead of invoking mock(SomeClass.class) I c

3条回答
  •  抹茶落季
    2020-12-06 04:43

    I'm not sure, but try to create new instance of ReportServiceImpl manually (as you did in working example):

     @InjectMocks 
     private ReportServiceImpl service = new ReportServiceImpl();
    

提交回复
热议问题