Skip to content

refactor(instrumentation): replace Mockito with MockK in ActivityTrac…#1262

Merged
breedx-splk merged 1 commit into
open-telemetry:mainfrom
amisha-chhajed:activity-tracer-cache-test
Oct 2, 2025
Merged

refactor(instrumentation): replace Mockito with MockK in ActivityTrac…#1262
breedx-splk merged 1 commit into
open-telemetry:mainfrom
amisha-chhajed:activity-tracer-cache-test

Conversation

@amisha-chhajed

Copy link
Copy Markdown
Contributor

Part of #1247.

@amisha-chhajed amisha-chhajed requested a review from a team as a code owner September 29, 2025 12:43
@codecov

codecov Bot commented Sep 29, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.30%. Comparing base (e8e213b) to head (7176178).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1262   +/-   ##
=======================================
  Coverage   64.30%   64.30%           
=======================================
  Files         142      142           
  Lines        3012     3012           
  Branches      296      296           
=======================================
  Hits         1937     1937           
  Misses        998      998           
  Partials       77       77           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fractalwrench fractalwrench left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@breedx-splk breedx-splk left a comment

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.

Thanks for the help! Much appreciated.

Mockito.verifyNoMoreInteractions(tracerCreator)

assertThat(result).isSameAs(activityTracer)
verify { activityTracer.initiateRestartSpanIfNecessary(false) }

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.

nit: we're missing the verification that no other interactions were done, but it's probably fine.

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.

@breedx-splk I was actually aware of it, should have mentioned in PR description, there is not a straightforward replacement of verifynointeraction in mockK, let me know if you want me to research about it more to find a potential one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@amishhaa you could use verify(exactly = 1) {} which will have a similar effect to verifyNoMoreInteractions

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.

@fractalwrench yes definitely! sorry for the delay, ill do it by EOD.

@amisha-chhajed amisha-chhajed force-pushed the activity-tracer-cache-test branch from d0fa88d to 7176178 Compare October 2, 2025 16:00
@amisha-chhajed

Copy link
Copy Markdown
Contributor Author

Done adding the changes cc: @fractalwrench, @breedx-splk

@breedx-splk breedx-splk merged commit eca9ad5 into open-telemetry:main Oct 2, 2025
8 checks passed
@breedx-splk

Copy link
Copy Markdown
Contributor

Thanks again for the contribution!

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.

3 participants