15
15
import io .github .artsok .RepeatedIfExceptionsTest ;
16
16
import io .netty .buffer .ByteBuf ;
17
17
import io .netty .buffer .Unpooled ;
18
- import jakarta .servlet .ServletException ;
19
18
import jakarta .servlet .http .HttpServletRequest ;
20
19
import jakarta .servlet .http .HttpServletResponse ;
21
20
import org .asynchttpclient .AbstractBasicTest ;
24
23
import org .eclipse .jetty .server .Request ;
25
24
import org .eclipse .jetty .server .handler .AbstractHandler ;
26
25
27
- import java .io .* ;
26
+ import java .io .IOException ;
28
27
import java .nio .charset .Charset ;
29
28
import java .time .Duration ;
30
- import java .util .Random ;
29
+ import java .util .Arrays ;
31
30
32
31
import static org .asynchttpclient .Dsl .asyncHttpClient ;
33
32
import static org .asynchttpclient .Dsl .config ;
@@ -51,8 +50,8 @@ public void testPutSmallBody() throws Exception {
51
50
52
51
@ RepeatedIfExceptionsTest (repeats = 5 )
53
52
public void testPutBigBody () throws Exception {
54
- byte [] array = new byte [2048 ]; // length is bounded by 7
55
- new Random (). nextBytes (array );
53
+ byte [] array = new byte [2048 ];
54
+ Arrays . fill (array , ( byte ) 97 );
56
55
String longString = new String (array , Charset .forName ("UTF-8" ));
57
56
58
57
put (longString );
@@ -63,7 +62,7 @@ public AbstractHandler configureHandler() throws Exception {
63
62
return new AbstractHandler () {
64
63
65
64
@ Override
66
- public void handle (String s , Request request , HttpServletRequest httpRequest , HttpServletResponse response ) throws IOException , ServletException {
65
+ public void handle (String s , Request request , HttpServletRequest httpRequest , HttpServletResponse response ) throws IOException {
67
66
int size = 1024 ;
68
67
if (request .getContentLength () > 0 ) {
69
68
size = request .getContentLength ();
0 commit comments