4
4
import io .netty .buffer .ByteBuf ;
5
5
import io .netty .buffer .Unpooled ;
6
6
7
- import java .util .Collections ;
8
- import java .util .LinkedList ;
9
- import java .util .List ;
10
-
11
7
import org .asynchttpclient .util .ByteBufUtils ;
12
8
import org .testng .annotations .Test ;
13
9
@@ -29,37 +25,4 @@ public void testByteBuf2BytesNoBackingArray() {
29
25
byte [] output = ByteBufUtils .byteBuf2Bytes (inputBuf );
30
26
assertEquals (output , inputBytes , "The bytes returned by byteBuf2Bytes do not match the bytes in the ByteBuf parameter" );
31
27
}
32
-
33
- @ Test
34
- public void testByteBufs2BytesEmptyList () {
35
- byte [] output = ByteBufUtils .byteBufs2Bytes (Collections .emptyList ());
36
- assertEquals (output , ByteBufUtils .EMPTY_BYTE_ARRAY ,
37
- "When an empty list is passed to byteBufs2Bytes, an empty byte array should be returned" );
38
- }
39
-
40
- @ Test
41
- public void testByteBufs2BytesSize1List () {
42
- byte [] inputBytes = "testdata" .getBytes ();
43
- ByteBuf inputBuf = Unpooled .copiedBuffer (inputBytes );
44
- byte [] output = ByteBufUtils .byteBufs2Bytes (Collections .singletonList (inputBuf ));
45
- assertEquals (output , inputBytes , "When a list of a single ByteBuf element is passed to byteBufs2Bytes,"
46
- + " the returned byte array should contain the bytes in that ByteBUf" );
47
- }
48
-
49
- @ Test
50
- public void testByteBufs2Bytes () {
51
- byte [] input1 = "testdata" .getBytes ();
52
- byte [] input2 = "testdata2" .getBytes ();
53
- byte [] input3 = "testdata3333" .getBytes ();
54
-
55
- List <ByteBuf > byteBufList = new LinkedList <>();
56
- byteBufList .add (Unpooled .copiedBuffer (input1 ));
57
- byteBufList .add (Unpooled .copiedBuffer (input2 ));
58
- byteBufList .add (Unpooled .copiedBuffer (input3 ));
59
-
60
- byte [] output = ByteBufUtils .byteBufs2Bytes (byteBufList );
61
- assertEquals (output .length , input1 .length + input2 .length + input3 .length ,
62
- "Returned bytes length should equal the sum of the parts" );
63
- }
64
-
65
28
}
0 commit comments