snazy commented on code in PR #7906:
URL: https://github.com/apache/iceberg/pull/7906#discussion_r1248763133
##########
build.gradle:
##########
@@ -337,6 +337,7 @@ project(':iceberg-api') {
project(':iceberg-common') {
dependencies {
implementation project(path: ':iceberg-bundled-guava', configuration:
'shadow')
+ implementation 'org.junit.jupiter:junit-jupiter'
Review Comment:
JUnit is a test dependency, should not added to production ("main") code
##########
dell/src/test/java/org/apache/iceberg/dell/ecs/TestEcsCatalog.java:
##########
@@ -41,36 +42,39 @@
import org.apache.iceberg.relocated.com.google.common.collect.Maps;
import org.apache.iceberg.types.Types;
import org.assertj.core.api.Assertions;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
-public class TestEcsCatalog {
Review Comment:
Let's not change the visibility in this PR, it's not necessary.
##########
common/src/main/java/org/apache/iceberg/common/testutils/PerTestCallbackWrapper.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * 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.iceberg.common.testutils;
+
+import org.junit.jupiter.api.extension.AfterEachCallback;
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
+
+/**
+ * This class is used to wrap a specific {@link CustomExtension} to junit5
extension with test-level
+ * callbacks {@link BeforeEachCallback} and {@link AfterEachCallback}. It can
be used as a
+ * substitute for @Rule in junit4.
+ */
+public class PerTestCallbackWrapper<C extends CustomExtension>
Review Comment:
Agree with @nastra here. `EcsS3MockExtension` should be the only JUnit
extension. JUnit allows injection - for static fields, instance fields and test
parameters. Also, `ExtensionContext` in JUnit is hierarchical (root, ..., test
class, test instance, test method, etc).
BTW test code must not end in production ("main") code.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]