Я пишу юнит-тест и получаю сообщение об ошибке Following stubbings are unnecessary
- Mockito.
org.mockito.exceptions.misusing.UnnecessaryStubbingException:
Unnecessary stubbings detected in test class: ADataPresenterTest
Clean & maintainable test code requires zero unnecessary code.
Following stubbings are unnecessary
@Test
fun `return empty list of quality control checks when offline data quality checks are null`() {
every(offlineDataStorage.offlineData.qualityChecks).thenReturn(null)// ERROR
val listOfQCChecks = presenter.getQualityControlCheckData(QualityControlMilestone.FUELLING_ENDED)
assertEquals(0, listOfQCChecks?.size)
}
@Test
fun `return empty list of quality control checks when offline data quality checks are empty`() {
val qualityControlChecks: ArrayList<QualityControlCheck> = ArrayList()
every(offlineDataStorage.offlineData.qualityChecks).thenReturn(qualityControlChecks)//ERROR
val listOfQCChecks = presenter.getQualityControlCheckData(QualityControlMilestone.FUELLING_ENDED)
assertEquals(0, listOfQCChecks?.size)
}
Не могли бы вы подсказать, как это исправить.
Спасибо R