You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/11 13:14:11 UTC

[GitHub] [pulsar] eolivelli commented on a diff in pull request #17579: [improve][test] remove WhiteBox on MockZooKeeper

eolivelli commented on code in PR #17579:
URL: https://github.com/apache/pulsar/pull/17579#discussion_r967827030


##########
testmocks/src/main/java/org/apache/zookeeper/MockZooKeeper.java:
##########
@@ -144,10 +144,7 @@ public static MockZooKeeper newInstanceForGlobalZK(ExecutorService executor, int
 
     public static MockZooKeeper newInstance(ExecutorService executor, int readOpDelayMs) {
         try {
-            MockZooKeeper zk = createMockZooKeeperInstance(executor, readOpDelayMs);
-            ObjectInstantiator<ClientCnxn> clientCnxnObjectInstantiator = objenesis.getInstantiatorOf(ClientCnxn.class);
-            Whitebox.setInternalState(zk, "cnxn", clientCnxnObjectInstantiator.newInstance());
-            return zk;
+            return createMockZooKeeperInstance(executor, readOpDelayMs);

Review Comment:
   Maybe the older versions of Mockito or other mock frameworks needed it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org