Migrate codec-redis to junit5 (#11426)

Motivation:

We should update to use junit5 in all modules.

Modifications:

Adjust codec-redis tests to use junit5

Result:

Part of https://github.com/netty/netty/issues/10757
This commit is contained in:
Norman Maurer 2021-06-30 13:59:57 +02:00 committed by GitHub
parent 2c3e78566e
commit be606df4f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,18 +19,18 @@ package io.netty.handler.codec.redis;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.embedded.EmbeddedChannel; import io.netty.channel.embedded.EmbeddedChannel;
import org.junit.After; import org.junit.jupiter.api.AfterEach;
import org.junit.Before; import org.junit.jupiter.api.BeforeEach;
import org.junit.Test; import org.junit.jupiter.api.Test;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;
import static io.netty.handler.codec.redis.RedisCodecTestUtil.*; import static io.netty.handler.codec.redis.RedisCodecTestUtil.*;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.hamcrest.MatcherAssert.assertThat;
/** /**
* Verifies the correct functionality of the {@link RedisEncoder}. * Verifies the correct functionality of the {@link RedisEncoder}.
@ -39,12 +39,12 @@ public class RedisEncoderTest {
private EmbeddedChannel channel; private EmbeddedChannel channel;
@Before @BeforeEach
public void setup() throws Exception { public void setup() throws Exception {
channel = new EmbeddedChannel(new RedisEncoder()); channel = new EmbeddedChannel(new RedisEncoder());
} }
@After @AfterEach
public void teardown() throws Exception { public void teardown() throws Exception {
assertFalse(channel.finish()); assertFalse(channel.finish());
} }