nastra commented on code in PR #3617:
URL: https://github.com/apache/parquet-java/pull/3617#discussion_r3441399141


##########
parquet-variant/src/test/java/org/apache/parquet/variant/TestVariantParseJson.java:
##########
@@ -18,191 +18,189 @@
  */
 package org.apache.parquet.variant;
 
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.within;
+
 import com.fasterxml.jackson.core.JsonFactory;
 import com.fasterxml.jackson.core.JsonParser;
 import java.io.IOException;
 import java.math.BigDecimal;
-import org.junit.Assert;
 import org.junit.Test;
 
 public class TestVariantParseJson {
 
   @Test
   public void testParseNull() throws IOException {
     Variant v = VariantJsonParser.parseJson("null");
-    Assert.assertEquals(Variant.Type.NULL, v.getType());
+    assertThat(v.getType()).isEqualTo(Variant.Type.NULL);
   }
 
   @Test
   public void testParseTrue() throws IOException {
     Variant v = VariantJsonParser.parseJson("true");
-    Assert.assertEquals(Variant.Type.BOOLEAN, v.getType());
-    Assert.assertTrue(v.getBoolean());
+    assertThat(v.getType()).isEqualTo(Variant.Type.BOOLEAN);
+    assertThat(v.getBoolean()).isTrue();
   }
 
   @Test
   public void testParseFalse() throws IOException {
     Variant v = VariantJsonParser.parseJson("false");
-    Assert.assertEquals(Variant.Type.BOOLEAN, v.getType());
-    Assert.assertFalse(v.getBoolean());
+    assertThat(v.getType()).isEqualTo(Variant.Type.BOOLEAN);
+    assertThat(v.getBoolean()).isFalse();
   }
 
   @Test
   public void testParseString() throws IOException {
     Variant v = VariantJsonParser.parseJson("\"hello world\"");
-    Assert.assertEquals(Variant.Type.STRING, v.getType());
-    Assert.assertEquals("hello world", v.getString());
+    assertThat(v.getType()).isEqualTo(Variant.Type.STRING);
+    assertThat(v.getString()).isEqualTo("hello world");
   }
 
   @Test
   public void testParseSmallInteger() throws IOException {
     Variant v = VariantJsonParser.parseJson("42");
-    Assert.assertEquals(Variant.Type.BYTE, v.getType());
-    Assert.assertEquals(42, v.getLong());
+    assertThat(v.getType()).isEqualTo(Variant.Type.BYTE);
+    assertThat(v.getLong()).isEqualTo(42);
   }
 
   @Test
   public void testParseShortInteger() throws IOException {
     Variant v = VariantJsonParser.parseJson("1000");
-    Assert.assertEquals(Variant.Type.SHORT, v.getType());
-    Assert.assertEquals(1000, v.getLong());
+    assertThat(v.getType()).isEqualTo(Variant.Type.SHORT);
+    assertThat(v.getLong()).isEqualTo(1000);
   }
 
   @Test
   public void testParseIntInteger() throws IOException {
     Variant v = VariantJsonParser.parseJson("100000");
-    Assert.assertEquals(Variant.Type.INT, v.getType());
-    Assert.assertEquals(100000, v.getLong());
+    assertThat(v.getType()).isEqualTo(Variant.Type.INT);
+    assertThat(v.getLong()).isEqualTo(100000);
   }
 
   @Test
   public void testParseLongInteger() throws IOException {
     Variant v = VariantJsonParser.parseJson("9999999999");
-    Assert.assertEquals(Variant.Type.LONG, v.getType());
-    Assert.assertEquals(9999999999L, v.getLong());
+    assertThat(v.getType()).isEqualTo(Variant.Type.LONG);
+    assertThat(v.getLong()).isEqualTo(9999999999L);
   }
 
   @Test
   public void testParseDecimalFloat() throws IOException {
     Variant v = VariantJsonParser.parseJson("3.14");
     Variant.Type type = v.getType();
-    Assert.assertTrue(
-        "Expected decimal type, got " + type,
-        type == Variant.Type.DECIMAL4 || type == Variant.Type.DECIMAL8 || type 
== Variant.Type.DECIMAL16);
-    Assert.assertEquals(0, new BigDecimal("3.14").compareTo(v.getDecimal()));
+    assertThat(type).isIn(Variant.Type.DECIMAL4, Variant.Type.DECIMAL8, 
Variant.Type.DECIMAL16);

Review Comment:
   if this check ever fails, then it will me much clearer what the issue is, 
because previously it would only say `false is not true`. I've modified the 
check to show how such an error msg would look:
   
   ```
   Expecting actual:
     DECIMAL16
   to be in:
     [DECIMAL4, DECIMAL8]
   ```



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

Reply via email to