@@ -29,7 +29,7 @@ public void flowableTransformerThrows() {
29
29
try {
30
30
Flowable .just (1 ).compose (new FlowableTransformer <Integer , Integer >() {
31
31
@ Override
32
- public Publisher <Integer > apply (Flowable <Integer > v ) throws Exception {
32
+ public Publisher <Integer > apply (Flowable <Integer > v ) {
33
33
throw new TestException ("Forced failure" );
34
34
}
35
35
});
@@ -39,28 +39,12 @@ public Publisher<Integer> apply(Flowable<Integer> v) throws Exception {
39
39
}
40
40
}
41
41
42
- @ Test
43
- public void flowableTransformerThrowsChecked () {
44
- try {
45
- Flowable .just (1 ).compose (new FlowableTransformer <Integer , Integer >() {
46
- @ Override
47
- public Publisher <Integer > apply (Flowable <Integer > v ) throws Exception {
48
- throw new IOException ("Forced failure" );
49
- }
50
- });
51
- fail ("Should have thrown!" );
52
- } catch (RuntimeException ex ) {
53
- assertTrue (ex .toString (), ex .getCause () instanceof IOException );
54
- assertEquals ("Forced failure" , ex .getCause ().getMessage ());
55
- }
56
- }
57
-
58
42
@ Test
59
43
public void observableTransformerThrows () {
60
44
try {
61
45
Observable .just (1 ).compose (new ObservableTransformer <Integer , Integer >() {
62
46
@ Override
63
- public Observable <Integer > apply (Observable <Integer > v ) throws Exception {
47
+ public Observable <Integer > apply (Observable <Integer > v ) {
64
48
throw new TestException ("Forced failure" );
65
49
}
66
50
});
@@ -70,28 +54,12 @@ public Observable<Integer> apply(Observable<Integer> v) throws Exception {
70
54
}
71
55
}
72
56
73
- @ Test
74
- public void observableTransformerThrowsChecked () {
75
- try {
76
- Observable .just (1 ).compose (new ObservableTransformer <Integer , Integer >() {
77
- @ Override
78
- public Observable <Integer > apply (Observable <Integer > v ) throws Exception {
79
- throw new IOException ("Forced failure" );
80
- }
81
- });
82
- fail ("Should have thrown!" );
83
- } catch (RuntimeException ex ) {
84
- assertTrue (ex .toString (), ex .getCause () instanceof IOException );
85
- assertEquals ("Forced failure" , ex .getCause ().getMessage ());
86
- }
87
- }
88
-
89
57
@ Test
90
58
public void singleTransformerThrows () {
91
59
try {
92
60
Single .just (1 ).compose (new SingleTransformer <Integer , Integer >() {
93
61
@ Override
94
- public Single <Integer > apply (Single <Integer > v ) throws Exception {
62
+ public Single <Integer > apply (Single <Integer > v ) {
95
63
throw new TestException ("Forced failure" );
96
64
}
97
65
});
@@ -101,28 +69,12 @@ public Single<Integer> apply(Single<Integer> v) throws Exception {
101
69
}
102
70
}
103
71
104
- @ Test
105
- public void singleTransformerThrowsChecked () {
106
- try {
107
- Single .just (1 ).compose (new SingleTransformer <Integer , Integer >() {
108
- @ Override
109
- public Single <Integer > apply (Single <Integer > v ) throws Exception {
110
- throw new IOException ("Forced failure" );
111
- }
112
- });
113
- fail ("Should have thrown!" );
114
- } catch (RuntimeException ex ) {
115
- assertTrue (ex .toString (), ex .getCause () instanceof IOException );
116
- assertEquals ("Forced failure" , ex .getCause ().getMessage ());
117
- }
118
- }
119
-
120
72
@ Test
121
73
public void maybeTransformerThrows () {
122
74
try {
123
75
Maybe .just (1 ).compose (new MaybeTransformer <Integer , Integer >() {
124
76
@ Override
125
- public Maybe <Integer > apply (Maybe <Integer > v ) throws Exception {
77
+ public Maybe <Integer > apply (Maybe <Integer > v ) {
126
78
throw new TestException ("Forced failure" );
127
79
}
128
80
});
@@ -132,28 +84,12 @@ public Maybe<Integer> apply(Maybe<Integer> v) throws Exception {
132
84
}
133
85
}
134
86
135
- @ Test
136
- public void maybeTransformerThrowsChecked () {
137
- try {
138
- Maybe .just (1 ).compose (new MaybeTransformer <Integer , Integer >() {
139
- @ Override
140
- public Maybe <Integer > apply (Maybe <Integer > v ) throws Exception {
141
- throw new IOException ("Forced failure" );
142
- }
143
- });
144
- fail ("Should have thrown!" );
145
- } catch (RuntimeException ex ) {
146
- assertTrue (ex .toString (), ex .getCause () instanceof IOException );
147
- assertEquals ("Forced failure" , ex .getCause ().getMessage ());
148
- }
149
- }
150
-
151
87
@ Test
152
88
public void completabeTransformerThrows () {
153
89
try {
154
90
Completable .complete ().compose (new CompletableTransformer () {
155
91
@ Override
156
- public Completable apply (Completable v ) throws Exception {
92
+ public Completable apply (Completable v ) {
157
93
throw new TestException ("Forced failure" );
158
94
}
159
95
});
@@ -162,20 +98,4 @@ public Completable apply(Completable v) throws Exception {
162
98
assertEquals ("Forced failure" , ex .getMessage ());
163
99
}
164
100
}
165
-
166
- @ Test
167
- public void completabeTransformerThrowsChecked () {
168
- try {
169
- Completable .complete ().compose (new CompletableTransformer () {
170
- @ Override
171
- public Completable apply (Completable v ) throws Exception {
172
- throw new IOException ("Forced failure" );
173
- }
174
- });
175
- fail ("Should have thrown!" );
176
- } catch (RuntimeException ex ) {
177
- assertTrue (ex .toString (), ex .getCause () instanceof IOException );
178
- assertEquals ("Forced failure" , ex .getCause ().getMessage ());
179
- }
180
- }
181
101
}
0 commit comments