Fix Stub override when argument is already defined
Mockito does not always support stub override. It fail when a a method has 2 stub with different argument matcher Ex: doReturn(x).when(y).method(any(Foo.class)); Foo foo = Foo(); doReturn(x).when(y).method(eq(foo)); <-- sub-match of above But the following "should" be ok Foo foo = Foo(); doReturn(x).when(y).method(eq(foo)); Bar bar = Bar(); doReturn(x).when(y).method(eq(bar)); <-- same scope match as above Test: atest BluetoothInstrumentationTests Bug: 256291144 Change-Id: Ie84e4bbe1ed3c479adc2a194972ba67e34839f50
Loading
Please register or sign in to comment