merlimat commented on a change in pull request #1805: Fixed Auth with v2 
protocol
URL: https://github.com/apache/bookkeeper/pull/1805#discussion_r232495457
 
 

 ##########
 File path: 
bookkeeper-server/src/test/java/org/apache/bookkeeper/auth/TestAuthMixed.java
 ##########
 @@ -0,0 +1,150 @@
+/*
+ *
+ * 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.auth;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Enumeration;
+
+import org.apache.bookkeeper.client.BKException;
+import org.apache.bookkeeper.client.BookKeeper;
+import org.apache.bookkeeper.client.BookKeeper.DigestType;
+import org.apache.bookkeeper.client.LedgerEntry;
+import org.apache.bookkeeper.client.LedgerHandle;
+import org.apache.bookkeeper.conf.ClientConfiguration;
+import org.apache.bookkeeper.proto.ClientConnectionPeer;
+import org.apache.bookkeeper.test.BookKeeperClusterTestCase;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Test authentication when enabled in client and disabled in bookie.
+ */
+@RunWith(Parameterized.class)
+public class TestAuthMixed extends BookKeeperClusterTestCase {
+    static final Logger LOG = LoggerFactory.getLogger(TestAuthMixed.class);
+    public static final String TEST_AUTH_PROVIDER_PLUGIN_NAME = 
"TestAuthProviderPlugin";
+
+    private static final byte[] PASSWD = "testPasswd".getBytes();
+    private static final byte[] ENTRY = "TestEntry".getBytes();
+
+    enum ProtocolVersion {
+        ProtocolV2, ProtocolV3
+    }
+
+    @Parameters
+    public static Collection<Object[]> configs() {
+        return Arrays.asList(new Object[][] {
+                { ProtocolVersion.ProtocolV2 },
+                { ProtocolVersion.ProtocolV3 },
+        });
+    }
+
+    private final ProtocolVersion protocolVersion;
+
+    public TestAuthMixed(ProtocolVersion protocolVersion) {
+        super(1);
+        this.protocolVersion = protocolVersion;
+    }
+
+    /**
+     * Test with a client that sends auth and bookie that has no auth provider.
 
 Review comment:
   Oh, I didn't see that. I started investigating this condition and that's why 
I wrote the test. No need to keep it, since it's the same test.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to