Classnotfoundexception in Java mockite testing

Asked

Viewed 14 times

-1

Hello,

When testing a class using Mockito, I came across the "Classnotfoundexception" error. Unfortunately I cannot resolve this error. All my dependencies are installed, but the error persists. I’ve checked numerous topics right here on Stackoverflow, but all solutions failed to solve my problem, even if I recreate the folder structure of the project

According to my research, the problem would be how the folders would be organized (src/project...), but since the beginning of my project I have always followed the standards of good practice in my codes.

Regarding the installation of the paths Jars, all were installed manually, and their versions are specified in the images below

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

1 answer

0

Your Junit test classes should be in a parallel directory. For example, if your code is in

projeto/src/main/java/br/com/pizzaria/...

Your test sources should be on, by convention:

projeto/src/test/java/br/com/pizzaria/...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.