llama90 commented on code in PR #42161:
URL: https://github.com/apache/arrow/pull/42161#discussion_r1641605915


##########
java/memory/memory-core/src/test/java/org/apache/arrow/memory/TestForeignAllocation.java:
##########
@@ -82,26 +84,27 @@ public void wrapForeignAllocationWithAllocationListener() {
     assertEquals(16, listener.getTotalMem());
   }
 
-  @Test(expected = OutOfMemoryException.class)
-  public void wrapForeignAllocationFailedWithAllocationListener() {
-    final long bufferSize = 16;
-    final long limit = bufferSize - 1;
-
-    final CountingAllocationListener listener = new 
CountingAllocationListener();
-    try (BufferAllocator listenedAllocator =
-        allocator.newChildAllocator("child", listener, 0L, limit)) {
-      UnsafeForeignAllocation allocation = new 
UnsafeForeignAllocation(bufferSize);
-      try {
-        assertEquals(0, listenedAllocator.getAllocatedMemory());
-        ArrowBuf buf = listenedAllocator.wrapForeignAllocation(allocation);
-        assertEquals(bufferSize, buf.capacity());
-        buf.close();
-        assertTrue(allocation.released);
-      } finally {
-        allocation.release0();
-      }
+    @Test
+    public void wrapForeignAllocationFailedWithAllocationListener() {
+        assertThrows(OutOfMemoryException.class, () -> {

Review Comment:
   Please run `mvn spotless:apply` for lint.



##########
java/memory/memory-core/src/test/java/org/apache/arrow/memory/TestAccountant.java:
##########
@@ -16,10 +16,11 @@
  */
 package org.apache.arrow.memory;
 
-import static org.junit.Assert.assertEquals;
+import org.junit.jupiter.api.Test;
 
-import org.junit.Assert;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.fail;

Review Comment:
   For consistency, it would be best to place `import static` statements before 
regular `import` statements.



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

Reply via email to