3232import org .eclipse .jetty .server .handler .AbstractHandler ;
3333import org .testng .annotations .Test ;
3434
35- public class FastUnauthorizedUploadTest extends AbstractBasicTest {
35+ public class FastUnauthorizedMultipartTest extends AbstractBasicTest {
3636
3737@ Override
3838public AbstractHandler configureHandler ()throws Exception {
@@ -49,14 +49,25 @@ public void handle(String target, Request baseRequest, HttpServletRequest req, H
4949 };
5050 }
5151
52- @ Test (groups ="standalone" )
53- public void testUnauthorizedWhileUploading ()throws Exception {
52+ @ Test (groups ="standalone" , enabled = false )
53+ public void testUnauthorizedWhileMultipart ()throws Exception {
5454File file =createTempFile (1024 *1024 );
5555
5656try (AsyncHttpClient client =asyncHttpClient ()) {
57- Response response =client .preparePut (getTargetUrl ()).addBodyPart (new FilePart ("test" ,file ,"application/octet-stream" ,UTF_8 )).execute ()
58- .get ();
57+ Response response =client .preparePut (getTargetUrl ()).addBodyPart (new FilePart ("test" ,file ,"application/octet-stream" ,UTF_8 )).execute ().get ();
5958assertEquals (response .getStatusCode (),401 );
6059 }
6160 }
61+
62+ public static void main (String []args )throws Exception {
63+ FastUnauthorizedMultipartTest test =new FastUnauthorizedMultipartTest ();
64+ test .setUpGlobal ();
65+ try {
66+ for (int i =0 ;i <20 ;i ++) {
67+ test .testUnauthorizedWhileMultipart ();
68+ }
69+ }finally {
70+ test .tearDownGlobal ();
71+ }
72+ }
6273}