error-prone
error-prone copied to clipboard
False positive for DirectInvocationOnMock
Code like this should be allowed for DirectInvocationOnMock:
import static org.mockito.Mockito.mock;
import static org.mockito.BDDMockito.given;
@Test
void test() {
Caller caller = mock(Caller.class);
given(caller.call()).willReturn(1);
}
Thanks for creating this issue. I was going to make one. Is this still under consideration?
https://github.com/google/error-prone/pull/3731 will address this issue Hope it's not too late @moonfruit
Still looking to get this reviewed & approved - everything should be ready, except the build does not pass as I've not been approved by a maintainer to run workflows.