Migrate codec-http to junit5 (#11440)

Motivation:

We should update to use junit5 in all modules.

Modifications:

Adjust codec-http tests to use junit5

Result:

Part of https://github.com/netty/netty/issues/10757
This commit is contained in:
Norman Maurer 2021-07-01 18:53:41 +02:00
parent 26a0efcb93
commit f84bfd2dd2
12 changed files with 145 additions and 136 deletions

View File

@ -26,7 +26,8 @@ import io.netty.handler.codec.DecoderResult;
import io.netty.handler.codec.EncoderException;
import io.netty.handler.codec.MessageToByteEncoder;
import io.netty.util.CharsetUtil;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.Executable;
import java.util.concurrent.atomic.AtomicBoolean;
@ -39,8 +40,8 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
public class HttpContentEncoderTest {
@ -425,12 +426,13 @@ public class HttpContentEncoderTest {
HttpContent content = new DefaultHttpContent(Unpooled.buffer().writeZero(10));
assertTrue(channel.writeOutbound(content));
assertEquals(1, content.refCnt());
try {
channel.finishAndReleaseAll();
fail();
} catch (CodecException expected) {
// expected
}
assertThrows(CodecException.class, new Executable() {
@Override
public void execute() {
channel.finishAndReleaseAll();
}
});
assertTrue(channelInactiveCalled.get());
assertEquals(0, content.refCnt());
}

View File

@ -20,7 +20,7 @@ import io.netty.buffer.Unpooled;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.DecoderResult;
import io.netty.util.CharsetUtil;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.util.Random;

View File

@ -27,7 +27,8 @@ import io.netty.util.AsciiString;
import io.netty.util.CharsetUtil;
import io.netty.util.ReferenceCountUtil;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.Executable;
import org.mockito.Mockito;
import java.nio.channels.ClosedChannelException;
@ -43,8 +44,8 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
public class HttpObjectAggregatorTest {
@ -119,11 +120,11 @@ public class HttpObjectAggregatorTest {
@Test
public void testOversizedRequest() {
EmbeddedChannel embedder = new EmbeddedChannel(new HttpObjectAggregator(4));
final EmbeddedChannel embedder = new EmbeddedChannel(new HttpObjectAggregator(4));
HttpRequest message = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.PUT, "http://localhost");
HttpContent chunk1 = new DefaultHttpContent(Unpooled.copiedBuffer("test", CharsetUtil.US_ASCII));
HttpContent chunk2 = new DefaultHttpContent(Unpooled.copiedBuffer("test2", CharsetUtil.US_ASCII));
HttpContent chunk3 = LastHttpContent.EMPTY_LAST_CONTENT;
final HttpContent chunk3 = LastHttpContent.EMPTY_LAST_CONTENT;
assertFalse(embedder.writeInbound(message));
assertFalse(embedder.writeInbound(chunk1));
@ -134,12 +135,12 @@ public class HttpObjectAggregatorTest {
assertEquals("0", response.headers().get(HttpHeaderNames.CONTENT_LENGTH));
assertFalse(embedder.isOpen());
try {
assertFalse(embedder.writeInbound(chunk3));
fail();
} catch (Exception e) {
assertTrue(e instanceof ClosedChannelException);
}
assertThrows(ClosedChannelException.class, new Executable() {
@Override
public void execute() {
embedder.writeInbound(chunk3);
}
});
assertFalse(embedder.finish());
}
@ -211,7 +212,7 @@ public class HttpObjectAggregatorTest {
}
private static void checkOversizedRequest(HttpRequest message) {
EmbeddedChannel embedder = new EmbeddedChannel(new HttpObjectAggregator(4));
final EmbeddedChannel embedder = new EmbeddedChannel(new HttpObjectAggregator(4));
assertFalse(embedder.writeInbound(message));
HttpResponse response = embedder.readOutbound();
@ -224,13 +225,13 @@ public class HttpObjectAggregatorTest {
if (serverShouldCloseConnection(message, response)) {
assertFalse(embedder.isOpen());
try {
embedder.writeInbound(new DefaultHttpContent(Unpooled.EMPTY_BUFFER));
fail();
} catch (Exception e) {
assertThat(e, instanceOf(ClosedChannelException.class));
// expected
}
assertThrows(ClosedChannelException.class, new Executable() {
@Override
public void execute() {
embedder.writeInbound(new DefaultHttpContent(Unpooled.EMPTY_BUFFER));
}
});
assertFalse(embedder.finish());
} else {
assertTrue(embedder.isOpen());
@ -281,43 +282,58 @@ public class HttpObjectAggregatorTest {
@Test
public void testOversizedResponse() {
EmbeddedChannel embedder = new EmbeddedChannel(new HttpObjectAggregator(4));
final EmbeddedChannel embedder = new EmbeddedChannel(new HttpObjectAggregator(4));
HttpResponse message = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
HttpContent chunk1 = new DefaultHttpContent(Unpooled.copiedBuffer("test", CharsetUtil.US_ASCII));
HttpContent chunk2 = new DefaultHttpContent(Unpooled.copiedBuffer("test2", CharsetUtil.US_ASCII));
final HttpContent chunk2 = new DefaultHttpContent(Unpooled.copiedBuffer("test2", CharsetUtil.US_ASCII));
assertFalse(embedder.writeInbound(message));
assertFalse(embedder.writeInbound(chunk1));
try {
embedder.writeInbound(chunk2);
fail();
} catch (TooLongFrameException expected) {
// Expected
}
assertThrows(TooLongFrameException.class, new Executable() {
@Override
public void execute() {
embedder.writeInbound(chunk2);
}
});
assertFalse(embedder.isOpen());
assertFalse(embedder.finish());
}
@Test(expected = IllegalArgumentException.class)
@Test
public void testInvalidConstructorUsage() {
new HttpObjectAggregator(-1);
assertThrows(IllegalArgumentException.class, new Executable() {
@Override
public void execute() {
new HttpObjectAggregator(-1);
}
});
}
@Test(expected = IllegalArgumentException.class)
@Test
public void testInvalidMaxCumulationBufferComponents() {
HttpObjectAggregator aggr = new HttpObjectAggregator(Integer.MAX_VALUE);
aggr.setMaxCumulationBufferComponents(1);
final HttpObjectAggregator aggr = new HttpObjectAggregator(Integer.MAX_VALUE);
assertThrows(IllegalArgumentException.class, new Executable() {
@Override
public void execute() {
aggr.setMaxCumulationBufferComponents(1);
}
});
}
@Test(expected = IllegalStateException.class)
@Test
public void testSetMaxCumulationBufferComponentsAfterInit() throws Exception {
HttpObjectAggregator aggr = new HttpObjectAggregator(Integer.MAX_VALUE);
final HttpObjectAggregator aggr = new HttpObjectAggregator(Integer.MAX_VALUE);
ChannelHandlerContext ctx = Mockito.mock(ChannelHandlerContext.class);
aggr.handlerAdded(ctx);
Mockito.verifyNoMoreInteractions(ctx);
aggr.setMaxCumulationBufferComponents(10);
assertThrows(IllegalStateException.class, new Executable() {
@Override
public void execute() {
aggr.setMaxCumulationBufferComponents(10);
}
});
}
@Test

View File

@ -20,8 +20,7 @@ import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.TooLongFrameException;
import io.netty.util.AsciiString;
import io.netty.util.CharsetUtil;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.util.List;

View File

@ -21,7 +21,8 @@ import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.DecoderResult;
import io.netty.util.CharsetUtil;
import io.netty.util.IllegalReferenceCountException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.Executable;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
@ -33,8 +34,8 @@ import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
/**
*/
@ -137,15 +138,17 @@ public class HttpRequestEncoderTest {
@Test
public void testEmptyReleasedBufferShouldNotWriteEmptyBufferToChannel() throws Exception {
HttpRequestEncoder encoder = new HttpRequestEncoder();
EmbeddedChannel channel = new EmbeddedChannel(encoder);
ByteBuf buf = Unpooled.buffer();
final EmbeddedChannel channel = new EmbeddedChannel(encoder);
final ByteBuf buf = Unpooled.buffer();
buf.release();
try {
channel.writeAndFlush(buf).get();
fail();
} catch (ExecutionException e) {
assertThat(e.getCause().getCause(), is(instanceOf(IllegalReferenceCountException.class)));
}
ExecutionException e = assertThrows(ExecutionException.class, new Executable() {
@Override
public void execute() throws Throwable {
channel.writeAndFlush(buf).get();
}
});
assertThat(e.getCause().getCause(), is(instanceOf(IllegalReferenceCountException.class)));
channel.finishAndReleaseAll();
}

View File

@ -17,7 +17,7 @@ package io.netty.handler.codec.http;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.util.ReferenceCountUtil;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;

View File

@ -16,13 +16,11 @@
package io.netty.handler.codec.http;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.util.AsciiString;
import io.netty.util.ReferenceCountUtil;
import io.netty.util.internal.StringUtil;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import java.util.Arrays;
import java.util.Collection;
@ -41,7 +39,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
@RunWith(Parameterized.class)
public class HttpServerKeepAliveHandlerTest {
private static final String REQUEST_KEEP_ALIVE = "REQUEST_KEEP_ALIVE";
private static final int NOT_SELF_DEFINED_MSG_LENGTH = 0;
@ -49,16 +46,14 @@ public class HttpServerKeepAliveHandlerTest {
private static final int SET_MULTIPART = 2;
private static final int SET_CHUNKED = 4;
private final boolean isKeepAliveResponseExpected;
private final HttpVersion httpVersion;
private final HttpResponseStatus responseStatus;
private final String sendKeepAlive;
private final int setSelfDefinedMessageLength;
private final String setResponseConnection;
private EmbeddedChannel channel;
@Parameters
public static Collection<Object[]> keepAliveProvider() {
@BeforeEach
public void setUp() {
channel = new EmbeddedChannel(new HttpServerKeepAliveHandler());
}
static Collection<Object[]> keepAliveProvider() {
return Arrays.asList(new Object[][] {
{ true, HttpVersion.HTTP_1_0, OK, REQUEST_KEEP_ALIVE, SET_RESPONSE_LENGTH, KEEP_ALIVE }, // 0
{ true, HttpVersion.HTTP_1_0, OK, REQUEST_KEEP_ALIVE, SET_MULTIPART, KEEP_ALIVE }, // 1
@ -78,31 +73,19 @@ public class HttpServerKeepAliveHandlerTest {
});
}
public HttpServerKeepAliveHandlerTest(boolean isKeepAliveResponseExpected, HttpVersion httpVersion,
HttpResponseStatus responseStatus, String sendKeepAlive,
int setSelfDefinedMessageLength, CharSequence setResponseConnection) {
this.isKeepAliveResponseExpected = isKeepAliveResponseExpected;
this.httpVersion = httpVersion;
this.responseStatus = responseStatus;
this.sendKeepAlive = sendKeepAlive;
this.setSelfDefinedMessageLength = setSelfDefinedMessageLength;
this.setResponseConnection = setResponseConnection == null? null : setResponseConnection.toString();
}
@Before
public void setUp() {
channel = new EmbeddedChannel(new HttpServerKeepAliveHandler());
}
@Test
public void test_KeepAlive() throws Exception {
@ParameterizedTest
@MethodSource("keepAliveProvider")
public void test_KeepAlive(boolean isKeepAliveResponseExpected, HttpVersion httpVersion,
HttpResponseStatus responseStatus,
String sendKeepAlive, int setSelfDefinedMessageLength,
AsciiString setResponseConnection) throws Exception {
FullHttpRequest request = new DefaultFullHttpRequest(httpVersion, HttpMethod.GET, "/v1/foo/bar");
setKeepAlive(request, REQUEST_KEEP_ALIVE.equals(sendKeepAlive));
HttpResponse response = new DefaultFullHttpResponse(httpVersion, responseStatus);
if (!StringUtil.isNullOrEmpty(setResponseConnection)) {
if (setResponseConnection != null) {
response.headers().set(HttpHeaderNames.CONNECTION, setResponseConnection);
}
setupMessageLength(response);
setupMessageLength(response, setSelfDefinedMessageLength);
assertTrue(channel.writeInbound(request));
Object requestForwarded = channel.readInbound();
@ -117,11 +100,27 @@ public class HttpServerKeepAliveHandlerTest {
assertFalse(channel.finishAndReleaseAll());
}
@Test
public void testConnectionCloseHeaderHandledCorrectly() throws Exception {
static Collection<Object[]> connectionCloseProvider() {
return Arrays.asList(new Object[][] {
{ HttpVersion.HTTP_1_0, OK, SET_RESPONSE_LENGTH },
{ HttpVersion.HTTP_1_0, OK, SET_MULTIPART },
{ HttpVersion.HTTP_1_0, OK, NOT_SELF_DEFINED_MSG_LENGTH },
{ HttpVersion.HTTP_1_0, NO_CONTENT, NOT_SELF_DEFINED_MSG_LENGTH },
{ HttpVersion.HTTP_1_1, OK, SET_RESPONSE_LENGTH },
{ HttpVersion.HTTP_1_1, OK, SET_MULTIPART },
{ HttpVersion.HTTP_1_1, OK, NOT_SELF_DEFINED_MSG_LENGTH },
{ HttpVersion.HTTP_1_1, OK, SET_CHUNKED },
{ HttpVersion.HTTP_1_1, NO_CONTENT, NOT_SELF_DEFINED_MSG_LENGTH }
});
}
@ParameterizedTest
@MethodSource("connectionCloseProvider")
public void testConnectionCloseHeaderHandledCorrectly(
HttpVersion httpVersion, HttpResponseStatus responseStatus, int setSelfDefinedMessageLength) {
HttpResponse response = new DefaultFullHttpResponse(httpVersion, responseStatus);
response.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE);
setupMessageLength(response);
setupMessageLength(response, setSelfDefinedMessageLength);
channel.writeAndFlush(response);
HttpResponse writtenResponse = channel.readOutbound();
@ -131,8 +130,12 @@ public class HttpServerKeepAliveHandlerTest {
assertFalse(channel.finishAndReleaseAll());
}
@Test
public void test_PipelineKeepAlive() {
@ParameterizedTest
@MethodSource("keepAliveProvider")
public void testPipelineKeepAlive(boolean isKeepAliveResponseExpected, HttpVersion httpVersion,
HttpResponseStatus responseStatus,
String sendKeepAlive, int setSelfDefinedMessageLength,
AsciiString setResponseConnection) {
FullHttpRequest firstRequest = new DefaultFullHttpRequest(httpVersion, HttpMethod.GET, "/v1/foo/bar");
setKeepAlive(firstRequest, true);
FullHttpRequest secondRequest = new DefaultFullHttpRequest(httpVersion, HttpMethod.GET, "/v1/foo/bar");
@ -167,12 +170,12 @@ public class HttpServerKeepAliveHandlerTest {
assertTrue(isKeepAlive(writtenInfoResp), "response keep-alive");
ReferenceCountUtil.release(writtenInfoResp);
if (!StringUtil.isNullOrEmpty(setResponseConnection)) {
if (setResponseConnection != null) {
response.headers().set(HttpHeaderNames.CONNECTION, setResponseConnection);
} else {
response.headers().remove(HttpHeaderNames.CONNECTION);
}
setupMessageLength(response);
setupMessageLength(response, setSelfDefinedMessageLength);
channel.writeAndFlush(response.retainedDuplicate());
HttpResponse secondResponse = channel.readOutbound();
assertEquals(isKeepAliveResponseExpected, channel.isOpen(), "channel.isOpen");
@ -193,7 +196,7 @@ public class HttpServerKeepAliveHandlerTest {
assertFalse(channel.finishAndReleaseAll());
}
private void setupMessageLength(HttpResponse response) {
private static void setupMessageLength(HttpResponse response, int setSelfDefinedMessageLength) {
switch (setSelfDefinedMessageLength) {
case NOT_SELF_DEFINED_MSG_LENGTH:
if (isContentLengthSet(response)) {

View File

@ -18,8 +18,6 @@ package io.netty.handler.codec.http;
import java.util.Collection;
import java.util.Collections;
import org.junit.Test;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelFutureListener;
@ -30,6 +28,7 @@ import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.http.HttpServerUpgradeHandler.UpgradeCodec;
import io.netty.handler.codec.http.HttpServerUpgradeHandler.UpgradeCodecFactory;
import io.netty.util.CharsetUtil;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@ -40,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.fail;
public class HttpServerUpgradeHandlerTest {
private class TestUpgradeCodec implements UpgradeCodec {
private static class TestUpgradeCodec implements UpgradeCodec {
@Override
public Collection<CharSequence> requiredUpgradeHeaders() {
return Collections.emptyList();

View File

@ -17,7 +17,7 @@ package io.netty.handler.codec.http;
import io.netty.util.CharsetUtil;
import io.netty.util.ReferenceCountUtil;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.Executable;
import java.net.InetAddress;

View File

@ -18,11 +18,9 @@ package io.netty.handler.codec.http;
import io.netty.buffer.Unpooled;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.util.CharsetUtil;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import java.util.Arrays;
import java.util.Collection;
@ -38,17 +36,9 @@ import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
@RunWith(Parameterized.class)
public class MultipleContentLengthHeadersTest {
private final boolean allowDuplicateContentLengths;
private final boolean sameValue;
private final boolean singleField;
private EmbeddedChannel channel;
@Parameters
public static Collection<Object[]> parameters() {
static Collection<Object[]> parameters() {
return Arrays.asList(new Object[][] {
{ false, false, false },
{ false, false, true },
@ -61,27 +51,22 @@ public class MultipleContentLengthHeadersTest {
});
}
public MultipleContentLengthHeadersTest(
boolean allowDuplicateContentLengths, boolean sameValue, boolean singleField) {
this.allowDuplicateContentLengths = allowDuplicateContentLengths;
this.sameValue = sameValue;
this.singleField = singleField;
}
@Before
public void setUp() {
private static EmbeddedChannel newChannel(boolean allowDuplicateContentLengths) {
HttpRequestDecoder decoder = new HttpRequestDecoder(
DEFAULT_MAX_INITIAL_LINE_LENGTH,
DEFAULT_MAX_HEADER_SIZE,
DEFAULT_VALIDATE_HEADERS,
DEFAULT_INITIAL_BUFFER_SIZE,
allowDuplicateContentLengths);
channel = new EmbeddedChannel(decoder);
return new EmbeddedChannel(decoder);
}
@Test
public void testMultipleContentLengthHeadersBehavior() {
String requestStr = setupRequestString();
@ParameterizedTest
@MethodSource("parameters")
public void testMultipleContentLengthHeadersBehavior(boolean allowDuplicateContentLengths,
boolean sameValue, boolean singleField) {
EmbeddedChannel channel = newChannel(allowDuplicateContentLengths);
String requestStr = setupRequestString(sameValue, singleField);
assertThat(channel.writeInbound(Unpooled.copiedBuffer(requestStr, CharsetUtil.US_ASCII)), is(true));
HttpRequest request = channel.readInbound();
@ -102,7 +87,7 @@ public class MultipleContentLengthHeadersTest {
assertThat(channel.finish(), is(false));
}
private String setupRequestString() {
private static String setupRequestString(boolean sameValue, boolean singleField) {
String firstValue = "1";
String secondValue = sameValue ? firstValue : "2";
String contentLength;
@ -119,6 +104,7 @@ public class MultipleContentLengthHeadersTest {
@Test
public void testDanglingComma() {
EmbeddedChannel channel = newChannel(false);
String requestStr = "GET /some/path HTTP/1.1\r\n" +
"Content-Length: 1,\r\n" +
"Connection: close\n\n" +

View File

@ -15,16 +15,17 @@
*/
package io.netty.handler.codec.rtsp;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import io.netty.buffer.Unpooled;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.http.FullHttpRequest;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpObject;
import io.netty.handler.codec.http.HttpObjectAggregator;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Test cases for RTSP decoder.

View File

@ -15,7 +15,6 @@
*/
package io.netty.handler.codec.rtsp;
import static org.junit.Assert.assertEquals;
import io.netty.buffer.ByteBuf;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.http.DefaultFullHttpRequest;
@ -27,8 +26,9 @@ import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.HttpResponse;
import io.netty.util.CharsetUtil;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Test cases for RTSP encoder.