Skip to content

Commit

Permalink
Use real method for bind service
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanvuong2021 committed Aug 7, 2024
1 parent b6ef502 commit e0eb1df
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ inline fun <reified T : AbstractCoroutineServerImpl> mockService(
): T =
mock(useConstructor = UseConstructor.parameterless()) { mock ->
on { context }.thenCallRealMethod()
on { bindService() }.thenCallRealMethod()
stubbing(mock)
}

/** Creates a mock for a gRPC coroutine service [T]. */
inline fun <reified T : AbstractCoroutineServerImpl> mockService(): T =
mock(useConstructor = UseConstructor.parameterless()) { on { context }.thenCallRealMethod() }
mock(useConstructor = UseConstructor.parameterless()) {
on { context }.thenCallRealMethod()
on { bindService() }.thenCallRealMethod()
}

0 comments on commit e0eb1df

Please sign in to comment.