@@ -3045,4 +3045,83 @@ public Publisher<Object> apply(Flowable<? extends Throwable> v) throws Exception
3045
3045
}
3046
3046
}).test ().assertResult (1 );
3047
3047
}
3048
+
3049
+ @ Test
3050
+ public void onErrorResumeNextEmpty () {
3051
+ Maybe .empty ()
3052
+ .onErrorResumeNext (Maybe .just (1 ))
3053
+ .test ()
3054
+ .assertNoValues ()
3055
+ .assertNoErrors ()
3056
+ .assertComplete ();
3057
+ }
3058
+
3059
+ @ Test
3060
+ public void onErrorResumeNextValue () {
3061
+ Maybe .just (1 )
3062
+ .onErrorResumeNext (Maybe .<Integer >empty ())
3063
+ .test ()
3064
+ .assertNoErrors ()
3065
+ .assertValue (1 );
3066
+ }
3067
+
3068
+ @ Test
3069
+ public void onErrorResumeNextError () {
3070
+ Maybe .error (new RuntimeException ("some error" ))
3071
+ .onErrorResumeNext (Maybe .empty ())
3072
+ .test ()
3073
+ .assertNoValues ()
3074
+ .assertNoErrors ()
3075
+ .assertComplete ();
3076
+ }
3077
+
3078
+ @ Test
3079
+ public void valueConcatWithValue () {
3080
+ Maybe .just (1 )
3081
+ .concatWith (Maybe .just (2 ))
3082
+ .test ()
3083
+ .assertNoErrors ()
3084
+ .assertComplete ()
3085
+ .assertValues (1 , 2 );
3086
+ }
3087
+
3088
+ @ Test
3089
+ public void errorConcatWithValue () {
3090
+ Maybe .<Integer >error (new RuntimeException ("error" ))
3091
+ .concatWith (Maybe .just (2 ))
3092
+ .test ()
3093
+ .assertError (RuntimeException .class )
3094
+ .assertErrorMessage ("error" )
3095
+ .assertNoValues ();
3096
+ }
3097
+
3098
+ @ Test
3099
+ public void valueConcatWithError () {
3100
+ Maybe .just (1 )
3101
+ .concatWith (Maybe .<Integer >error (new RuntimeException ("error" )))
3102
+ .test ()
3103
+ .assertValue (1 )
3104
+ .assertError (RuntimeException .class )
3105
+ .assertErrorMessage ("error" );
3106
+ }
3107
+
3108
+ @ Test
3109
+ public void emptyConcatWithValue () {
3110
+ Maybe .<Integer >empty ()
3111
+ .concatWith (Maybe .just (2 ))
3112
+ .test ()
3113
+ .assertNoErrors ()
3114
+ .assertComplete ()
3115
+ .assertValues (2 );
3116
+ }
3117
+
3118
+ @ Test
3119
+ public void emptyConcatWithError () {
3120
+ Maybe .<Integer >empty ()
3121
+ .concatWith (Maybe .<Integer >error (new RuntimeException ("error" )))
3122
+ .test ()
3123
+ .assertNoValues ()
3124
+ .assertError (RuntimeException .class )
3125
+ .assertErrorMessage ("error" );
3126
+ }
3048
3127
}
0 commit comments