sijie commented on a change in pull request #510: Issue-605 BP-15 New 
CreateLedger API
URL: https://github.com/apache/bookkeeper/pull/510#discussion_r142210022
 
 

 ##########
 File path: 
bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperBuildersTest.java
 ##########
 @@ -0,0 +1,609 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.bookkeeper.client;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.Unpooled;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicReference;
+import org.apache.bookkeeper.client.LedgerCreateOp.CreateBuilderImpl;
+import org.apache.bookkeeper.client.LedgerDeleteOp.DeleteBuilderImpl;
+import org.apache.bookkeeper.client.LedgerOpenOp.OpenBuilderImpl;
+import org.apache.bookkeeper.client.api.DigestType;
+import org.apache.bookkeeper.client.api.WriteAdvHandle;
+import org.apache.bookkeeper.client.api.WriteHandle;
+import org.apache.bookkeeper.common.concurrent.FutureUtils;
+import org.apache.bookkeeper.conf.ClientConfiguration;
+import org.apache.bookkeeper.net.BookieSocketAddress;
+import org.apache.bookkeeper.proto.BookkeeperInternalCallbacks;
+import 
org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.ReadEntryCallback;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import org.junit.Test;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.eq;
+import org.mockito.Mockito;
+import static org.mockito.Mockito.when;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+/**
+ * Unit tests of builders
+ */
+public class BookKeeperBuildersTest extends MockBookKeeperTestCase {
+
+    @Test
+    public void testCreateLedger() throws Exception {
+
+        int ensembleSize = 3;
+        int writeQuorumSize = 2;
+        int ackQuorumSize = 1;
+        Map<String, byte[]> customMetadata = new HashMap<>();
+
+        when(bookieWatcher.newEnsemble(ensembleSize, writeQuorumSize, 
ackQuorumSize, customMetadata))
 
 Review comment:
   I think I was suggesting to put the common mocking stuffs into a util class, 
no?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to