我有斯卡拉類這樣的: @Component
class SomeClassForTest {
@Autowired
implicit val type: Type = null
...
}
純春天,這個代碼做工精細。但磨片我試圖創建測試用的Mockito: @RunWith(classOf[JUnitRunner])
class SomeClassForTest {
作爲我的另一個問題的附錄:How to create Spock mocks outside of a specification class? - 是否有可能改變規範之外的Mocks行爲? 在我們的項目中,我們有很多在我們的規格代碼讀取這樣的: someService.findById(SomeMother.SOME_OBJECT.id) >> SomeMother.SOME_OBJECT
s
我正在使用Jasmine來單元測試具有異步運行方法的Angular控制器。我能夠成功地向控制器注入依賴關係,但是我不得不改變處理異步的方法,因爲我的測試會在數據加載之前運行。我目前正試圖窺探模擬依賴並使用andCallThrough(),但它導致錯誤TypeError: undefined is not a function。 這裏是我的控制器...... myApp.controller('my