From f9ca270e62a1f81f7003ba8cf633e2b4318ebec9 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Fri, 28 May 2021 09:26:51 +0200 Subject: [PATCH] Fix test-error which was introduced by porting tests to junit5 (#11330) Motivation: b89a807d15fd925c21d3c875836145cd5302c8c9 moved the buffer tests to junit5 but introduced a small error which could lead to test-failure Modifications: Correctly override the method and assert that super throws (as we can not expand the buffer). Result: No more test failures --- .../buffer/WrappedUnpooledUnsafeByteBufTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/buffer/src/test/java/io/netty/buffer/WrappedUnpooledUnsafeByteBufTest.java b/buffer/src/test/java/io/netty/buffer/WrappedUnpooledUnsafeByteBufTest.java index ffd037513c..dda2b58ff4 100644 --- a/buffer/src/test/java/io/netty/buffer/WrappedUnpooledUnsafeByteBufTest.java +++ b/buffer/src/test/java/io/netty/buffer/WrappedUnpooledUnsafeByteBufTest.java @@ -148,6 +148,17 @@ public class WrappedUnpooledUnsafeByteBufTest extends BigEndianUnsafeDirectByteB assertThrows(IndexOutOfBoundsException.class, super::testWriteUtf16CharSequenceExpand); } + @Test + @Override + public void testGetBytesByteBuffer() { + assertThrows(IndexOutOfBoundsException.class, new Executable() { + @Override + public void execute() { + WrappedUnpooledUnsafeByteBufTest.super.testGetBytesByteBuffer(); + } + }); + } + @Test @Override public void testForEachByteDesc2() {