question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'this' is not available - when enabling mock-maker-inline

See original GitHub issue

When we enable mock-maker-inline in our project and debug a class with @Spy annotated on it IntelliJ reports that 'this' is not available: image

When we unset mock-maker-inline then things work as expected and we can inspect the class variables: image

It appears to be the same as this report: https://stackoverflow.com/questions/62661996/unable-to-debug-junit-test-anywhere

Is this expected Mockito behaviour?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:32 (19 by maintainers)

github_iconTop GitHub Comments

5reactions
afillatrecommented, Apr 4, 2021

Same issue with Mockito-inline 3.8.0 and java 15. This makes tests very difficult to debug, because it makes impossible to debug the code step by step

4reactions
raphwcommented, Jun 1, 2021

It should fix both. A new release is underway in this minute.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using mockito-inline in project throws "Mockito cannot mock ...
MockMaker file in project's src/test/resources/mockito-extensions ... up the post Mockito fails with inlined mocks enabled with Invalid ...
Read more >
How to use the Mockito's inline mock maker - David Vlijmincx
Option 2: Adding a file to enable the Mock maker inline. Create a resources directory in your test directory if you do not...
Read more >
Mockito 4.2.0 API - javadoc.io
The Mockito library enables mock creation, verification and stubbing. ... Be aware that you cannot use the inline mock maker on Android due...
Read more >
Mock Final Classes and Methods with Mockito - Baeldung
mock -maker-inline. Copy. Mockito checks the extensions directory for configuration files when it is loaded. This file enables the mocking of ...
Read more >
Enable the option to mock final classes | by André Mion
MockMaker. It's a simple text file, in which you have to write: mock-maker-inline. Read at: https://antonioleiva.com/mockito-2-kotlin/.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found