ctubbsii commented on code in PR #5192:
URL: https://github.com/apache/accumulo/pull/5192#discussion_r1901364132
##########
test/src/main/java/org/apache/accumulo/test/conf/store/PropStoreZooKeeperIT.java:
##########
@@ -101,11 +100,11 @@ public static void shutdownZK() throws Exception {
@BeforeEach
public void setupZnodes() throws Exception {
- var zrw = testZk.getZooReaderWriter();
+ var zrw = new ZooReaderWriter(zooKeeper);
instanceId = InstanceId.of(UUID.randomUUID());
- context = EasyMock.createNiceMock(ServerContext.class);
+ context = createMock(ServerContext.class);
expect(context.getInstanceID()).andReturn(instanceId).anyTimes();
- expect(context.getZooReaderWriter()).andReturn(zrw).anyTimes();
+ expect(context.getZooSession()).andReturn(zooKeeper).anyTimes();
Review Comment:
No. zrw is only used to set up the test directories in this method. The code
being tested uses a ZooSession obtained from a mock ServerContext. That
ZooSession needs to be the real ZooKeeper client session for the
ZooKeeperTestingServer. However, I will make a slight improvement by inlining
the zrw and removing the use of the ZooReaderWriter constructor using
asReaderWriter(), which can be done since `zooKeeper` here is a real ZooKeeper
client, not a mock object. I'll also rename the variable to just `zk`, for
consistency with other code (because why not?)
Changed in a03de14f8ee383b7f195e45a8c5bfe5db427ed27
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]