I'm facing this error while navigating to other fragment. I want to test if particular fragment is navigating to correct fragment or not. How Can it be possible can anyone help me. Thanks
fun matchIntendedDestination(id: Int) {
val idCapture = ArgumentCaptor.forClass(Int::class.java)
Mockito.verify(BaseHelper.getMockNavController())
.navigate(idCapture.capture())
Assert.assertEquals(
R.id.action_fragment_from_a_to_b, idCapture.value
)
}
This method is giving me this error again and again
Wanted but not invoked:
navController.navigate(<Capturing argument>);
-> at com.rupeek.loanreleaseapp.helper.ReleaseRejectionHelper.matchIntendedDestination(ReleaseRejectionHelper.kt:118)
Actually, there were zero interactions with this mock.
at com.rupeek.loanreleaseapp.helper.ReleaseRejectionHelper.matchIntendedDestination(ReleaseRejectionHelper.kt:118)
at com.rupeek.loanreleaseapp.step.BaseStep.userWillBeNavigatedToScreen(BaseStep.java:50)
at ✽.User will be navigated to "CHECK_LIST_SCREEN" screen(file:features/jewels_packed_admin_approval.feature:20)