org.mockito.exceptions.base.MockitoException:
Cannot instantiate @InjectMocks field named ‘productLogic’ of type ‘class .ProductLogic’.
You haven’t provided the instance at field declaration so I tried to construct the instance.
However the constructor or the initialization block threw an exception : GC overhead limit exceeded
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
我在編譯的時候運行了所有的單元測試,結果就報了這個錯,
但是單獨運行這個單元測試是沒問題的。
嘗試了一下解決方案:
1.修改IDEA的運行內存,調大到了8192M
修改完重啟仍然有這個錯誤,用了第二種方法
懷疑是我的IDEA窗口開了太多,關了其他窗口只留了當前項目,結果就可以了。。。
另外也可以檢查一下stash的區域是不是有較大的變動,有可能也和這個有關。