@@ -35,34 +35,34 @@ public void tearDown() {
35
35
}
36
36
37
37
public void testConsumerAllocatesBufferLimit () throws IOException {
38
- consumer .consume (randomByteBufferOfLength (1000 ).flip ());
38
+ consumer .consume (( ByteBuffer ) randomByteBufferOfLength (1000 ).flip ());
39
39
assertThat (consumer .getBuffer ().capacity (), equalTo (1000 ));
40
40
}
41
41
42
42
public void testConsumerAllocatesEmptyBuffer () throws IOException {
43
- consumer .consume (ByteBuffer .allocate (0 ).flip ());
43
+ consumer .consume (( ByteBuffer ) ByteBuffer .allocate (0 ).flip ());
44
44
assertThat (consumer .getBuffer ().capacity (), equalTo (0 ));
45
45
}
46
46
47
47
public void testConsumerExpandsBufferLimits () throws IOException {
48
- consumer .consume (randomByteBufferOfLength (1000 ).flip ());
49
- consumer .consume (randomByteBufferOfLength (2000 ).flip ());
50
- consumer .consume (randomByteBufferOfLength (3000 ).flip ());
48
+ consumer .consume (( ByteBuffer ) randomByteBufferOfLength (1000 ).flip ());
49
+ consumer .consume (( ByteBuffer ) randomByteBufferOfLength (2000 ).flip ());
50
+ consumer .consume (( ByteBuffer ) randomByteBufferOfLength (3000 ).flip ());
51
51
assertThat (consumer .getBuffer ().capacity (), equalTo (6000 ));
52
52
}
53
53
54
54
public void testConsumerAllocatesLimit () throws IOException {
55
- consumer .consume (randomByteBufferOfLength (BUFFER_LIMIT ).flip ());
55
+ consumer .consume (( ByteBuffer ) randomByteBufferOfLength (BUFFER_LIMIT ).flip ());
56
56
assertThat (consumer .getBuffer ().capacity (), equalTo (BUFFER_LIMIT ));
57
57
}
58
58
59
59
public void testConsumerFailsToAllocateOverLimit () throws IOException {
60
- assertThrows (ContentTooLongException .class , () -> consumer .consume (randomByteBufferOfLength (BUFFER_LIMIT + 1 ).flip ()));
60
+ assertThrows (ContentTooLongException .class , () -> consumer .consume (( ByteBuffer ) randomByteBufferOfLength (BUFFER_LIMIT + 1 ).flip ()));
61
61
}
62
62
63
63
public void testConsumerFailsToExpandOverLimit () throws IOException {
64
- consumer .consume (randomByteBufferOfLength (BUFFER_LIMIT ).flip ());
65
- assertThrows (ContentTooLongException .class , () -> consumer .consume (randomByteBufferOfLength (1 ).flip ()));
64
+ consumer .consume (( ByteBuffer ) randomByteBufferOfLength (BUFFER_LIMIT ).flip ());
65
+ assertThrows (ContentTooLongException .class , () -> consumer .consume (( ByteBuffer ) randomByteBufferOfLength (1 ).flip ()));
66
66
}
67
67
68
68
private static ByteBuffer randomByteBufferOfLength (int length ) {
0 commit comments