From 2e8f0a0326bbe3c4163cf162c74e7ed5f242fdc6 Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Thu, 17 Mar 2022 23:13:41 +0800 Subject: [PATCH] HBASE-26833 Addendum fix NPE in TestReplicationSource.testTerminateClearsBuffer (cherry picked from commit bd65ad42a297335a09ad862761e44ba101d97770) --- .../hbase/replication/regionserver/TestReplicationSource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSource.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSource.java index 484bd5be3bb7..6da360054576 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSource.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSource.java @@ -291,8 +291,8 @@ public void testTerminateClearsBuffer() throws Exception { ReplicationPeer mockPeer = mock(ReplicationPeer.class); Mockito.when(mockPeer.getPeerBandwidth()).thenReturn(0L); Configuration testConf = HBaseConfiguration.create(); - source.init(testConf, null, mockManager, null, mockPeer, null, - "testPeer", null, p -> OptionalLong.empty(), mock(MetricsSource.class)); + source.init(testConf, null, mockManager, null, mockPeer, Mockito.mock(Server.class), "testPeer", + null, p -> OptionalLong.empty(), mock(MetricsSource.class)); ReplicationSourceWALReader reader = new ReplicationSourceWALReader(null, conf, null, 0, null, source, null); ReplicationSourceShipper shipper =