@@ -445,57 +445,6 @@ public void renderFailure() throws Exception {
445445 .build (isA (List .class ), isA (List .class ), eq (StandardCharsets .UTF_8 ), isA (Map .class ));
446446
447447 expect (renderer .format (isA (Sse .Event .class ))).andThrow (new IOException ("failure" ));
448- renderer .clear ();
449- })
450- .run (unit -> {
451- Sse sse = new Sse () {
452-
453- @ Override
454- protected void closeInternal () {
455- }
456-
457- @ Override
458- protected void fireCloseEvent () {
459- }
460-
461- @ Override
462- protected Promise <Optional <Object >> send (final Optional <Object > id , final byte [] data ) {
463- Promise <Optional <Object >> promise = Promise
464- .make (MoreExecutors .newDirectExecutorService ());
465- promise .failure (new IOException ("intentional err" ));
466- return promise ;
467- }
468-
469- @ Override
470- public Sse keepAlive (final long millis ) {
471- return this ;
472- }
473-
474- @ Override
475- protected void handshake (final Runnable handler ) throws Exception {
476- }
477- };
478- sse .handshake (unit .get (Request .class ), unit .get (Runnable .class ));
479- sse .event (data ).type (MediaType .all ).send ().onFailure (cause -> latch .countDown ());
480- latch .await ();
481- });
482- }
483-
484- @ SuppressWarnings ("resource" )
485- @ Test (expected = IllegalStateException .class )
486- public void sendFailure () throws Exception {
487- CountDownLatch latch = new CountDownLatch (1 );
488- Object data = new Object ();
489- new MockUnit (Request .class , Route .class , Injector .class , Runnable .class )
490- .expect (handshake )
491- .expect (unit -> {
492- SseRenderer renderer = unit .constructor (SseRenderer .class )
493- .args (List .class , List .class , Charset .class , Map .class )
494- .build (isA (List .class ), isA (List .class ), eq (StandardCharsets .UTF_8 ), isA (Map .class ));
495-
496- expect (renderer .format (isA (Sse .Event .class ))).andReturn (new byte [0 ]);
497- renderer .clear ();
498- expectLastCall ().andThrow (new IllegalStateException ("intentional err" ));
499448 })
500449 .run (unit -> {
501450 Sse sse = new Sse () {
0 commit comments