From 2ea670021bed5e7886042e1d2fe90b5725789e6e Mon Sep 17 00:00:00 2001 From: Riley Park Date: Thu, 27 May 2021 06:57:36 -0700 Subject: [PATCH] Migrate transport-native-unix-common tests to JUnit 5 (#11321) Motivation: JUnit 5 is more expressive, extensible, and composable in many ways, and it's better able to run tests in parallel. Modifications: Use JUnit5 in tests Result: Related to https://github.com/netty/netty/issues/10757 --- .../io/netty/channel/unix/UnixChannelUtilTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/transport-native-unix-common/src/test/java/io/netty/channel/unix/UnixChannelUtilTest.java b/transport-native-unix-common/src/test/java/io/netty/channel/unix/UnixChannelUtilTest.java index 62035c7978..83895ad40f 100644 --- a/transport-native-unix-common/src/test/java/io/netty/channel/unix/UnixChannelUtilTest.java +++ b/transport-native-unix-common/src/test/java/io/netty/channel/unix/UnixChannelUtilTest.java @@ -21,16 +21,16 @@ import io.netty.buffer.ByteBufAllocator; import io.netty.buffer.CompositeByteBuf; import io.netty.buffer.PooledByteBufAllocator; import io.netty.buffer.UnpooledByteBufAllocator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Collections; import java.util.LinkedList; import java.util.List; import static io.netty.channel.unix.UnixChannelUtil.isBufferCopyNeededForWrite; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class UnixChannelUtilTest { @@ -82,7 +82,7 @@ public class UnixChannelUtilTest { comp.addComponent(byteBuf); } - assertEquals(byteBufs.toString(), expected, isBufferCopyNeededForWrite(comp, IOV_MAX)); + assertEquals(expected, isBufferCopyNeededForWrite(comp, IOV_MAX), byteBufs.toString()); assertTrue(comp.release()); } }