error-prone icon indicating copy to clipboard operation
error-prone copied to clipboard

False positive for DirectInvocationOnMock

Open moonfruit opened this issue 3 years ago • 3 comments

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);
}

moonfruit avatar Aug 16 '22 09:08 moonfruit

Thanks for creating this issue. I was going to make one. Is this still under consideration?

RobertTheBlair avatar Jan 09 '23 17:01 RobertTheBlair

https://github.com/google/error-prone/pull/3731 will address this issue Hope it's not too late @moonfruit

RobertTheBlair avatar Jan 25 '23 00:01 RobertTheBlair

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.

RobertTheBlair avatar Feb 01 '23 23:02 RobertTheBlair