diff options
author | 2025-03-05 04:03:19 -0800 | |
---|---|---|
committer | 2025-03-06 01:52:48 -0800 | |
commit | 09f4d728bf3582e1f776025674f9c70c3402b71d (patch) | |
tree | fc1a949479323fc6ae81f1678540008b2fcc2cbe /ravenwood/junit-src | |
parent | 448853d016acb7367f3946824b9671f9db2cee84 (diff) |
RavenwoodUtils: remove verifyZeroInteractions wrapper
This is no longer necessary, with the upgrade to Mockito 3 `verifyNoInteractions` is now in the tree.
There are two downsides to having this available:
- The current implementation of MockitoHelper.verifyZeroInteractions will fail at runtime when on-device tests migrate to Mockito 4+
- Mockito.verifyZeroInteractions has the same behavior as
verify no*More*Interactions. Tests using MockitoHelper.verifyZeroInteractions will therefore observe different behavior on ravenwood and on-device.
Bug: 310268946
Test: n/a, deleted code without usage
Flag: TEST_ONLY
Change-Id: I8e1406a99d748828724b6ac82d2a018a53e725ea
Diffstat (limited to 'ravenwood/junit-src')
-rw-r--r-- | ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodUtils.java | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodUtils.java b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodUtils.java index 3e2c4051b792..f25ae6a34242 100644 --- a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodUtils.java +++ b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodUtils.java @@ -128,28 +128,6 @@ public class RavenwoodUtils { runOnHandlerSync(getMainHandler(), r); } - public static class MockitoHelper { - private MockitoHelper() { - } - - /** - * Allow verifyZeroInteractions to work on ravenwood. It was replaced with a different - * method on. (Maybe we should do it in Ravenizer.) - */ - public static void verifyZeroInteractions(Object... mocks) { - if (RavenwoodRule.isOnRavenwood()) { - // Mockito 4 or later - reflectMethod("org.mockito.Mockito", "verifyNoInteractions", Object[].class) - .callStatic(new Object[]{mocks}); - } else { - // Mockito 2 - reflectMethod("org.mockito.Mockito", "verifyZeroInteractions", Object[].class) - .callStatic(new Object[]{mocks}); - } - } - } - - /** * Wrap the given {@link Supplier} to become memoized. * |