Skip to content
Snippets Groups Projects
  1. Nov 02, 2022
  2. Nov 01, 2022
  3. Oct 31, 2022
  4. Oct 30, 2022
  5. Oct 29, 2022
    • William Escande's avatar
    • William Escande's avatar
      Fix Stub override when argument is already defined · 89f1bb1e
      William Escande authored
      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
      89f1bb1e
  6. Oct 28, 2022
Loading