diff --git a/java-storage-nio/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/CloudStorageIsDirectoryTest.java b/java-storage-nio/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/CloudStorageIsDirectoryTest.java index e78d6859de6f..a2662debf0fe 100644 --- a/java-storage-nio/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/CloudStorageIsDirectoryTest.java +++ b/java-storage-nio/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/CloudStorageIsDirectoryTest.java @@ -36,6 +36,7 @@ import org.junit.rules.TestName; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import org.mockito.Mockito; /** Unit tests for {@code Files.isDirectory()}. */ @RunWith(JUnit4.class) @@ -69,7 +70,7 @@ public void testIsDirectoryNoUserProject() { CloudStorageFileSystem.forBucket("bucket", CloudStorageConfiguration.DEFAULT, mockOptions); when(mockStorage.get(BlobId.of("bucket", "test", null))) .thenThrow(new IllegalArgumentException()); - Page pages = mock(Page.class); + Page pages = Mockito.mock(Page.class, Mockito.withSettings().withoutAnnotations()); Blob blob = mock(Blob.class); when(blob.getBlobId()).thenReturn(BlobId.of("bucket", "test/hello.txt")); when(pages.getValues()).thenReturn(Lists.newArrayList(blob)); @@ -91,7 +92,7 @@ public void testIsDirectoryWithUserProject() { mockOptions); when(mockStorage.get(BlobId.of("bucket", "test", null))) .thenThrow(new IllegalArgumentException()); - Page pages = mock(Page.class); + Page pages = Mockito.mock(Page.class, Mockito.withSettings().withoutAnnotations()); Blob blob = mock(Blob.class); when(blob.getBlobId()).thenReturn(BlobId.of("bucket", "test/hello.txt")); when(pages.getValues()).thenReturn(Lists.newArrayList(blob));