Skip to content

fix: update mock generic config service#40

Merged
aaron-steinfeld merged 1 commit intomainfrom
update-generic-mock
Apr 30, 2021
Merged

fix: update mock generic config service#40
aaron-steinfeld merged 1 commit intomainfrom
update-generic-mock

Conversation

@aaron-steinfeld
Copy link
Copy Markdown
Contributor

Description

When using inline mocks, we want to use the real bind service in our mock config service. Also bumped some services.

issue showed up when using inline mocks
@github-actions

This comment has been minimized.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2021

Codecov Report

Merging #40 (2d4f035) into main (8c96796) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            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           
Flag Coverage Δ Complexity Δ
integration 90.90% <ø> (ø) 49.00 <ø> (ø)
unit 87.09% <ø> (ø) 100.00 <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c96796...2d4f035. Read the comment docs.

Mockito.mock(
ConfigServiceImplBase.class,
invocation -> { // Error if unmocked called so we don't hang waiting for streamobserver
if (invocation
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why is it needed now ? We have mocked all methods in config service right.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@aaron-steinfeld aaron-steinfeld merged commit 0a70387 into main Apr 30, 2021
@aaron-steinfeld aaron-steinfeld deleted the update-generic-mock branch April 30, 2021 11:34
@github-actions
Copy link
Copy Markdown

Unit Test Results

10 files  ±0  10 suites  ±0   6s ⏱️ -2s
32 tests ±0  32 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 0a70387. ± Comparison against base commit 8c96796.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants