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.

Org.Mockito cannot be resolved

See original GitHub issue

Currently working on a Java8 Maven project (I have all of the Java extensions along with Maven for Java) and when trying to compile and run the tests, the compiler is throwing this error. image

My import statement is this: import static org.mockito.Mockito.*;

I have tried everything short of importing the individual methods that I am using, but I don’t believe that I should have to do that. Has anyone else encountered this problem?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

6reactions
jdneocommented, Apr 15, 2019

@JarrodBlanton Could you please try:

  1. Trigger the command :Java: clean the java language server workspace
  2. Select restart and delete
  3. See if the errors still occur
0reactions
saumilsdkcommented, Jul 26, 2020

@jdneo Thanks that vs code command helped.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix "The import org.mockito cannot be resolved"?
In Project, Go to: Build Path --> Configuration Path,. In Java Build Path, Go to: Source. In both directories src/test/java and ...
Read more >
Highlighting error 'cannot resolve symbol any' when ...
When using ScalaTest and Mockito, the line following the comment below reports cannot resolve symbol any incorrectly. import org.mockito.Matchers.
Read more >
Mockito Notes - Java Hot Chocolate
Mockito.doAnswer; import static org.mockito.Mockito.doNothing; import static org.mockito. ... Cannot resolve method 'thenReturn(resultMap)' ...in this code:.
Read more >
the import org.mockito.junit.mockitojunitrunner cannot be ...
the import org.mockito.junit.mockitojunitrunner cannot be resolved · Oops, You will need to install Grepper and log-in to perform this action.
Read more >
Class MockitoJUnitRunner cannot be resolved to a type
To solve the error “…cannot be resolved to a type..” do the followings: Right click on the class and select “Build Path–>Exclude”. Again...
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