komoot / photon

an open source geocoder for openstreetmap data
Apache License 2.0
1.83k stars 278 forks source link

Removed 1 unnecessary stubbing in RequestLanguageTest.java  #753

Closed ARUS2023 closed 8 months ago

ARUS2023 commented 8 months ago

In our analysis of the project, we observed that 1) 1 stubbing which stubbed headers is created in RequestLanguageTest.buildRequest method but never executed in 3 tests: RequestLanguageTest.testValidQueryLangs, RequestLanguageTest.testLanguageNotSupported, RequestLanguageTest.testPriorityOfQueryParam.

Unnecessary stubbings are stubbed method calls that were never realized during test execution. Mockito recommends to remove unnecessary stubbings (https://www.javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/exceptions/misusing/UnnecessaryStubbingException.html).

We propose below a solution to remove the unnecessary stubbings.