org.mockito.exceptions.misusing.UnnecessaryStubbingException: Unnecessary stubbings detected in test class: MockitoProblemTest Clean & maintainable test code requires zero unnecessary code. Following stubbings are unnecessary (click to navigate to relevant line of code):


Solutions on the web

Solution icon of github
via GitHub by gysel
, 9 months ago
Unnecessary stubbings detected in test class: MockitoProblemTest Clean & maintainable test code requires zero unnecessary code. Following stubbings are unnecessary (click to navigate to relevant line of code):

Solution icon of github
Unnecessary stubbings detected in test class: MockitoProblem Clean & maintainable test code requires zero unnecessary code. Following stubbings are unnecessary (click to navigate to relevant line of code):

Stack trace

org.mockito.exceptions.misusing.UnnecessaryStubbingException: Unnecessary stubbings detected in test class: MockitoProblemTest
Clean & maintainable test code requires zero unnecessary code.
Following stubbings are unnecessary (click to navigate to relevant line of code):
	at ch.mgysel.mockito.MainComponent.<init>(MainComponent.java:10)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.