You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey folks, i am trying to write some UTs around my Novu service class. For that i am using mockito to mock the behavior of Novu. However, I am blocked because the APIs are marked as internal which makes is accessible only to its project scope. Any workaround i can do to mock Novu and do something like this:
@Mock
private lateinit var novu: Novu
@InjectMocks
private lateinit var notifService: NotifService
...
@Test
fun `test-success`() = runTest {
whenever(novu.subscribers()).thenReturn(...) <---------- this is where it throws NPE because subscriberApi isnt mocked and is internal
notifService.getSubscribers()
}
The text was updated successfully, but these errors were encountered:
Hey folks, i am trying to write some UTs around my Novu service class. For that i am using mockito to mock the behavior of Novu. However, I am blocked because the APIs are marked as internal which makes is accessible only to its project scope. Any workaround i can do to mock Novu and do something like this:
The text was updated successfully, but these errors were encountered: