You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "rakesh-das08 (via GitHub)" <gi...@apache.org> on 2023/05/27 18:21:15 UTC

[GitHub] [iceberg] rakesh-das08 commented on a diff in pull request #7666: Api: Switch tests to Junit5

rakesh-das08 commented on code in PR #7666:
URL: https://github.com/apache/iceberg/pull/7666#discussion_r1208089939


##########
api/src/test/java/org/apache/iceberg/TestIcebergBuild.java:
##########
@@ -18,33 +18,40 @@
  */
 package org.apache.iceberg;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import java.util.Locale;
 import java.util.regex.Pattern;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class TestIcebergBuild {
   @Test
   public void testFullVersion() {
-    Assert.assertEquals(
-        "Should build full version from version and commit ID",
-        "Apache Iceberg " + IcebergBuild.version() + " (commit " + IcebergBuild.gitCommitId() + ")",
-        IcebergBuild.fullVersion());
+    assertThat(IcebergBuild.fullVersion())
+        .as("Should build full version from version and commit ID")
+        .isEqualTo(
+            "Apache Iceberg "
+                + IcebergBuild.version()
+                + " (commit "
+                + IcebergBuild.gitCommitId()
+                + ")");
   }
 
   @Test
   public void testVersion() {
-    Assert.assertNotEquals("Should not use unknown version", "unknown", IcebergBuild.version());
+    assertThat(IcebergBuild.version()).as("Should not use unknown version").isNotEqualTo("unknown");
   }
 
   @Test
   public void testGitCommitId() {
-    Assert.assertNotEquals(
-        "Should not use unknown commit ID", "unknown", IcebergBuild.gitCommitId());
-    Assert.assertTrue(
-        "Should be a hexadecimal string of 20 bytes",
-        Pattern.compile("[0-9a-f]{40}")
-            .matcher(IcebergBuild.gitCommitId().toLowerCase(Locale.ROOT))
-            .matches());
+    assertThat(IcebergBuild.gitCommitId())
+        .as("Should not use unknown commit ID")
+        .isNotEqualTo("unknown");
+    assertThat(
+            Pattern.compile("[0-9a-f]{40}")
+                .matcher(IcebergBuild.gitCommitId().toLowerCase(Locale.ROOT))
+                .matches())
+        .as("Should be a hexadecimal string of 20 bytes")
+        .isTrue();

Review Comment:
   Sure will make the suggested change.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org