yanghua commented on a change in pull request #1530:
URL: https://github.com/apache/incubator-hudi/pull/1530#discussion_r412693956
##########
File path:
hudi-common/src/test/java/org/apache/hudi/common/table/TestHoodieTableMetaClient.java
##########
@@ -18,41 +18,41 @@
package org.apache.hudi.common.table;
-import org.apache.hudi.common.HoodieCommonTestHarness;
import org.apache.hudi.common.model.HoodieTestUtils;
import org.apache.hudi.common.table.timeline.HoodieActiveTimeline;
import org.apache.hudi.common.table.timeline.HoodieInstant;
import org.apache.hudi.common.table.timeline.HoodieTimeline;
+import org.apache.hudi.common.testutils.HoodieCommonTestHarnessJunit5;
import org.apache.hudi.common.util.Option;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
/**
* Tests hoodie table meta client {@link HoodieTableMetaClient}.
*/
-public class TestHoodieTableMetaClient extends HoodieCommonTestHarness {
+public class TestHoodieTableMetaClient extends HoodieCommonTestHarnessJunit5 {
- @Before
+ @BeforeEach
public void init() throws IOException {
initMetaClient();
}
@Test
public void checkMetadata() {
- assertEquals("Table name should be raw_trips",
HoodieTestUtils.RAW_TRIPS_TEST_NAME,
- metaClient.getTableConfig().getTableName());
- assertEquals("Basepath should be the one assigned", basePath,
metaClient.getBasePath());
- assertEquals("Metapath should be ${basepath}/.hoodie", basePath +
"/.hoodie", metaClient.getMetaPath());
+ assertEquals(HoodieTestUtils.RAW_TRIPS_TEST_NAME,
metaClient.getTableConfig().getTableName(), "Table name should be raw_trips");
Review comment:
here
##########
File path:
hudi-common/src/test/java/org/apache/hudi/common/table/TestHoodieTableMetaClient.java
##########
@@ -67,16 +67,15 @@ public void checkSerDe() {
commitTimeline.saveAsComplete(instant,
Option.of("test-detail".getBytes()));
commitTimeline = commitTimeline.reload();
HoodieInstant completedInstant =
HoodieTimeline.getCompletedInstant(instant);
- assertEquals("Commit should be 1 and completed", completedInstant,
commitTimeline.getInstants().findFirst().get());
- assertArrayEquals("Commit value should be \"test-detail\"",
"test-detail".getBytes(),
- commitTimeline.getInstantDetails(completedInstant).get());
+ assertEquals(completedInstant,
commitTimeline.getInstants().findFirst().get(), "Commit should be 1 and
completed");
+ assertArrayEquals("test-detail".getBytes(),
commitTimeline.getInstantDetails(completedInstant).get(), "Commit value should
be \"test-detail\"");
Review comment:
here
##########
File path:
hudi-common/src/test/java/org/apache/hudi/common/table/TestHoodieTableMetaClient.java
##########
@@ -85,21 +84,20 @@ public void checkCommitTimeline() {
// Commit timeline should not auto-reload every time
getActiveCommitTimeline(), it should be cached
activeTimeline = metaClient.getActiveTimeline();
activeCommitTimeline = activeTimeline.getCommitTimeline();
- assertTrue("Should be empty commit timeline",
activeCommitTimeline.empty());
+ assertTrue(activeCommitTimeline.empty(), "Should be empty commit
timeline");
HoodieInstant completedInstant =
HoodieTimeline.getCompletedInstant(instant);
activeTimeline = activeTimeline.reload();
activeCommitTimeline = activeTimeline.getCommitTimeline();
- assertFalse("Should be the 1 commit we made",
activeCommitTimeline.empty());
- assertEquals("Commit should be 1", completedInstant,
activeCommitTimeline.getInstants().findFirst().get());
- assertArrayEquals("Commit value should be \"test-detail\"",
"test-detail".getBytes(),
- activeCommitTimeline.getInstantDetails(completedInstant).get());
+ assertFalse(activeCommitTimeline.empty(), "Should be the 1 commit we
made");
+ assertEquals(completedInstant,
activeCommitTimeline.getInstants().findFirst().get(), "Commit should be 1");
+ assertArrayEquals("test-detail".getBytes(),
activeCommitTimeline.getInstantDetails(completedInstant).get(), "Commit value
should be \"test-detail\"");
Review comment:
here
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]