fix: update mock generic config service#40
Conversation
issue showed up when using inline mocks
This comment has been minimized.
This comment has been minimized.
Codecov Report
@@ Coverage Diff @@
## main #40 +/- ##
=========================================
Coverage 90.90% 90.90%
Complexity 109 109
=========================================
Files 14 14
Lines 418 418
Branches 18 18
=========================================
Hits 380 380
Misses 32 32
Partials 6 6
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
| Mockito.mock( | ||
| ConfigServiceImplBase.class, | ||
| invocation -> { // Error if unmocked called so we don't hang waiting for streamobserver | ||
| if (invocation |
There was a problem hiding this comment.
Just curious, why is it needed now ? We have mocked all methods in config service right.
There was a problem hiding this comment.
So I believe what happened is the behavior was dependent on the mock maker. When the constructor is called, it adds the mock service to the server builder, which tries to bind it by calling bindService. Using the default mock maker as we normally do it works (although I'm not quite sure why - it could be a discrepancy on init order?), but using the inline mock maker (for support of final and static mocking) it was failing due to the default invocation behavior here.
Description
When using inline mocks, we want to use the real bind service in our mock config service. Also bumped some services.