ctubbsii commented on a change in pull request #2427:
URL: https://github.com/apache/accumulo/pull/2427#discussion_r810895229
##########
File path:
core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloMultiTableInputFormatTest.java
##########
@@ -29,24 +29,20 @@
import org.apache.accumulo.core.util.Pair;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.JobConf;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TestName;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
@Deprecated(since = "2.0.0")
public class AccumuloMultiTableInputFormatTest {
- @Rule
- public TestName testName = new TestName();
-
/**
* Verify {@link org.apache.accumulo.core.client.mapreduce.InputTableConfig}
objects get correctly
* serialized in the JobContext.
*/
@Test
- public void testTableQueryConfigSerialization() {
- String table1Name = testName.getMethodName() + "1";
- String table2Name = testName.getMethodName() + "2";
+ public void testTableQueryConfigSerialization(TestInfo testInfo) {
+ String table1Name = testInfo.getDisplayName() + "1";
Review comment:
I found the best way to do it is to create a superclass for the test
that has a `testName()` method and a `@BeforeEach` annotation that sets the
test name from the `TestInfo` class. See `WithTestNames` in the core module.
The same can be done for other modules that need it. However, the class would
need to be duplicated for any modules that use it, because of the way test code
does not have dependencies on test code in other modules, and because we can't
put the test class with JUnit types into the main jar, or else it would add a
JUnit dependency there, which we don't want.
--
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]