lhotari commented on code in PR #23449:
URL: https://github.com/apache/pulsar/pull/23449#discussion_r1808086967


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SubscriptionTestBase.java:
##########
@@ -0,0 +1,84 @@
+/*
+ * 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.pulsar.broker.service;
+
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import org.apache.pulsar.broker.BrokerTestUtil;
+import org.apache.pulsar.common.api.proto.CommandSubscribe;
+import org.apache.pulsar.common.api.proto.KeySharedMeta;
+import org.apache.pulsar.common.api.proto.KeySharedMode;
+import org.testng.annotations.DataProvider;
+
+public abstract class SubscriptionTestBase {

Review Comment:
   The test looks great now.
   
   > Maybe it makes sense to extract a method from this (or parts of it):
   
   I think it's fine for a test, especially in the Pulsar codebase. 
   By the way, not directly related to our topic of discussion, but for new 
tests, it would be great to enable using JUnit 5 instead of requiring the usage 
of TestNG for all tests. In BookKeeper, [Junit 5 has been enabled (Junit 4 was 
used before instead of 
TestNG)](https://github.com/apache/bookkeeper/pulls?q=is%3Apr+is%3Aclosed+%22junit+5%22).
 It would also be great to prefer AssertJ for assertions since the error 
messages are very useful in AssertJ when a test fails. In Pulsar tests, AssertJ 
is already used in some tests.



-- 
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]

Reply via email to