opengrok
opengrok copied to clipboard
HistoryGuru#getLastHistoryEntry() is not really covered by tests
the HistoryGuru cannot be tested with Mockito because it is final class so the fallback to repository.getLastHistoryEntry() in HistoryGuru#getLastHistoryEntry() is not really covered
There are workarounds for mocking final classes: e.g. https://stackoverflow.com/questions/14292863/how-to-mock-a-final-class-with-mockito (just don't use PowerMock :D)
Otherwise looks good to me.
Originally posted by @ahornace in https://github.com/oracle/opengrok/issues/3861#issuecomment-1006038466
@vladak can I contribute to this? is no one working on it?
can you please once confirm if we can use MockitoV2 for final class mocking
@vladak can I contribute to this? is no one working on it?
Whoever submits the PR first wins :-) Joking aside, given the amount of contributions OpenGrok gets, it's pretty much guaranteed that no one is working on it at the moment. Certainly I don't plan to.
can you please once confirm if we can use MockitoV2 for final class mocking
Do you mean Mockito 2.x ? If so, OpenGrok is already on 3.x.