Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(806)

Unified Diff: components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/browser/WebRestrictionsClientTest.java

Issue 2076783004: Changes to update Junit and Mockito. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding myself to junit OWNERS Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/browser/WebRestrictionsClientTest.java
diff --git a/components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/browser/WebRestrictionsClientTest.java b/components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/browser/WebRestrictionsClientTest.java
index 3b17c1f80845b7f96e3807d9ca31a1a34af94b25..92906756023a9c00ad4375acd9d2797537aae2ea 100644
--- a/components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/browser/WebRestrictionsClientTest.java
+++ b/components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/browser/WebRestrictionsClientTest.java
@@ -7,9 +7,10 @@ package org.chromium.components.webrestrictions.browser;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyLong;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -66,9 +67,8 @@ public class WebRestrictionsClientTest {
public void testShouldProceed() {
ShadowContentResolver.registerProvider(TEST_CONTENT_PROVIDER, mProvider);
- when(mProvider.query(any(Uri.class), any(String[].class), anyString(), any(String[].class),
- anyString()))
- .thenReturn(null);
+ when(mProvider.query(any(Uri.class), (String[]) isNull(), anyString(), (String[]) isNull(),
+ (String) isNull())).thenReturn(null);
WebRestrictionsClientResult result = mTestClient.shouldProceed("http://example.com");
verify(mProvider).query(Uri.parse("content://" + TEST_CONTENT_PROVIDER + "/authorized"),
null, "url = 'http://example.com'", null, null);
@@ -82,18 +82,16 @@ public class WebRestrictionsClientTest {
when(cursor.getColumnName(1)).thenReturn("Error Int");
when(cursor.getColumnName(2)).thenReturn("Error String");
when(cursor.getColumnCount()).thenReturn(3);
- when(mProvider.query(any(Uri.class), any(String[].class), anyString(), any(String[].class),
- anyString()))
- .thenReturn(cursor);
+ when(mProvider.query(any(Uri.class), (String[]) isNull(), anyString(),
+ (String[]) isNull(), (String) isNull())).thenReturn(cursor);
result = mTestClient.shouldProceed("http://example.com");
assertThat(result.shouldProceed(), is(true));
assertThat(result.getInt(1), is(42));
assertThat(result.getString(2), is("No error"));
when(cursor.getInt(0)).thenReturn(0);
- when(mProvider.query(any(Uri.class), any(String[].class), anyString(), any(String[].class),
- anyString()))
- .thenReturn(cursor);
+ when(mProvider.query(any(Uri.class), (String[]) isNull(), anyString(),
+ (String[]) isNull(), (String) isNull())).thenReturn(cursor);
result = mTestClient.shouldProceed("http://example.com");
assertThat(result.shouldProceed(), is(false));
}

Powered by Google App Engine
This is Rietveld 408576698