This is an automated email from the ASF dual-hosted git repository.
zike pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 40b9d7ea50c [cleanup][tests] Fixed various compiler warnings (#16484)
40b9d7ea50c is described below
commit 40b9d7ea50cef54becb09f2543193e08375abe0b
Author: Dave Maughan <[email protected]>
AuthorDate: Thu Aug 25 10:47:01 2022 +0100
[cleanup][tests] Fixed various compiler warnings (#16484)
## Motivation
Reduce build noise by fixing compiler warnings
## Modifications
Fixed various compiler warnings in the pulsar-package-bookkeeper-storage
module
---
.../storage/bookkeeper/DLOutputStreamTest.java | 17 +++++++++--------
.../bookkeeper/test/BookKeeperClusterTestCase.java | 2 +-
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git
a/pulsar-package-management/bookkeeper-storage/src/test/java/org/apache/pulsar/packages/management/storage/bookkeeper/DLOutputStreamTest.java
b/pulsar-package-management/bookkeeper-storage/src/test/java/org/apache/pulsar/packages/management/storage/bookkeeper/DLOutputStreamTest.java
index c815a5d7017..b7b1c35cba3 100644
---
a/pulsar-package-management/bookkeeper-storage/src/test/java/org/apache/pulsar/packages/management/storage/bookkeeper/DLOutputStreamTest.java
+++
b/pulsar-package-management/bookkeeper-storage/src/test/java/org/apache/pulsar/packages/management/storage/bookkeeper/DLOutputStreamTest.java
@@ -22,7 +22,6 @@ package
org.apache.pulsar.packages.management.storage.bookkeeper;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.Collections;
-import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
@@ -35,7 +34,7 @@ import org.testng.annotations.Test;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyList;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.times;
import static org.testng.AssertJUnit.assertEquals;
@@ -54,8 +53,10 @@ public class DLOutputStreamTest {
when(dlm.asyncClose()).thenReturn(CompletableFuture.completedFuture(null));
when(writer.markEndOfStream()).thenReturn(CompletableFuture.completedFuture(null));
when(writer.asyncClose()).thenReturn(CompletableFuture.completedFuture(null));
- when(writer.writeBulk(any(List.class)))
-
.thenReturn(CompletableFuture.completedFuture(Collections.singletonList(DLSN.InitialDLSN)));
}
+ when(writer.writeBulk(anyList()))
+ .thenReturn(CompletableFuture.completedFuture(
+
Collections.singletonList(CompletableFuture.completedFuture(DLSN.InitialDLSN))));
+ }
@AfterMethod(alwaysRun = true)
public void teardown() throws IOException {
@@ -74,7 +75,7 @@ public class DLOutputStreamTest {
.thenCompose(w -> w.writeAsync(new ByteArrayInputStream(data))
.thenCompose(DLOutputStream::closeAsync)).get();
- verify(writer, times(1)).writeBulk(any(List.class));
+ verify(writer, times(1)).writeBulk(anyList());
verify(writer, times(1)).markEndOfStream();
verify(writer, times(1)).asyncClose();
verify(dlm, times(1)).asyncClose();
@@ -90,7 +91,7 @@ public class DLOutputStreamTest {
.thenCompose(w -> w.writeAsync(new ByteArrayInputStream(data))
.thenCompose(DLOutputStream::closeAsync)).get();
- verify(writer, times(1)).writeBulk(any(List.class));
+ verify(writer, times(1)).writeBulk(anyList());
verify(writer, times(1)).markEndOfStream();
verify(writer, times(1)).asyncClose();
verify(dlm, times(1)).asyncClose();
@@ -103,7 +104,7 @@ public class DLOutputStreamTest {
.thenCompose(w -> w.writeAsync(new ByteArrayInputStream(data))
.thenCompose(DLOutputStream::closeAsync)).get();
- verify(writer, times(1)).writeBulk(any(List.class));
+ verify(writer, times(1)).writeBulk(anyList());
verify(writer, times(1)).markEndOfStream();
verify(writer, times(1)).asyncClose();
verify(dlm, times(1)).asyncClose();
@@ -122,7 +123,7 @@ public class DLOutputStreamTest {
@Test
public void writeRecordFailed() {
- when(writer.writeBulk(any(List.class)))
+ when(writer.writeBulk(anyList()))
.thenReturn(failedFuture(new Exception("Write data was failed")));
byte[] data = "test-write".getBytes();
diff --git
a/pulsar-package-management/bookkeeper-storage/src/test/java/org/apache/pulsar/packages/management/storage/bookkeeper/bookkeeper/test/BookKeeperClusterTestCase.java
b/pulsar-package-management/bookkeeper-storage/src/test/java/org/apache/pulsar/packages/management/storage/bookkeeper/bookkeeper/test/BookKeeperClusterTestCase.java
index 3444b0287d9..565a066c5f4 100644
---
a/pulsar-package-management/bookkeeper-storage/src/test/java/org/apache/pulsar/packages/management/storage/bookkeeper/bookkeeper/test/BookKeeperClusterTestCase.java
+++
b/pulsar-package-management/bookkeeper-storage/src/test/java/org/apache/pulsar/packages/management/storage/bookkeeper/bookkeeper/test/BookKeeperClusterTestCase.java
@@ -719,7 +719,7 @@ public abstract class BookKeeperClusterTestCase {
return tester;
}
- public void setMetastoreImplClass(AbstractConfiguration conf) {
+ public void setMetastoreImplClass(AbstractConfiguration<?> conf) {
conf.setMetastoreImplClass(InMemoryMetaStore.class.getName());
}