@@ -1872,10 +1872,11 @@ public void doOnErrorThrows() {
18721872
18731873 try {
18741874 c .await ();
1875- } catch (IllegalStateException ex ) {
1876- Throwable [] a = ex .getSuppressed ();
1877- Assert .assertEquals (1 , a .length );
1878- Assert .assertTrue (a [0 ] instanceof TestException );
1875+ } catch (CompositeException ex ) {
1876+ List <Throwable > a = ex .getExceptions ();
1877+ Assert .assertEquals (2 , a .size ());
1878+ Assert .assertTrue (a .get (0 ) instanceof TestException );
1879+ Assert .assertTrue (a .get (1 ) instanceof IllegalStateException );
18791880 }
18801881 }
18811882
@@ -2217,11 +2218,11 @@ public Completable call(Throwable e) {
22172218 try {
22182219 c .await ();
22192220 Assert .fail ("Did not throw an exception" );
2220- } catch (NullPointerException ex ) {
2221- Throwable [] a = ex .getSuppressed ();
2222-
2223- Assert .assertEquals ( 1 , a . length );
2224- Assert .assertTrue (a [ 0 ] instanceof TestException );
2221+ } catch (CompositeException ex ) {
2222+ List < Throwable > a = ex .getExceptions ();
2223+ Assert . assertEquals ( 2 , a . size ());
2224+ Assert .assertTrue ( a . get ( 0 ) instanceof TestException );
2225+ Assert .assertTrue (a . get ( 1 ) instanceof NullPointerException );
22252226 }
22262227 }
22272228
@@ -2235,11 +2236,11 @@ public void onErrorResumeNextFunctionThrows() {
22352236 try {
22362237 c .await ();
22372238 Assert .fail ("Did not throw an exception" );
2238- } catch (TestException ex ) {
2239- Throwable [] a = ex .getSuppressed ();
2240-
2241- Assert .assertEquals ( 1 , a . length );
2242- Assert .assertTrue (a [ 0 ] instanceof TestException );
2239+ } catch (CompositeException ex ) {
2240+ List < Throwable > a = ex .getExceptions ();
2241+ Assert . assertEquals ( 2 , a . size ());
2242+ Assert .assertTrue ( a . get ( 0 ) instanceof TestException );
2243+ Assert .assertTrue (a . get ( 1 ) instanceof TestException );
22432244 }
22442245 }
22452246
0 commit comments