18
18
import static java .util .Arrays .*;
19
19
import static org .assertj .core .api .Assertions .*;
20
20
21
+ import io .reactivex .rxjava3 .core .Completable ;
22
+ import io .reactivex .rxjava3 .core .Observable ;
23
+ import io .reactivex .rxjava3 .core .Single ;
21
24
import io .vavr .control .Option ;
22
25
import io .vavr .control .Try ;
23
26
import lombok .Value ;
24
27
import reactor .core .publisher .Flux ;
25
28
import reactor .core .publisher .Mono ;
26
- import rx .Completable ;
27
- import rx .Observable ;
28
- import rx .Single ;
29
29
30
30
import java .lang .reflect .Method ;
31
31
import java .math .BigDecimal ;
41
41
import org .assertj .core .api .SoftAssertions ;
42
42
import org .junit .jupiter .api .Test ;
43
43
import org .reactivestreams .Publisher ;
44
+
44
45
import org .springframework .dao .InvalidDataAccessApiUsageException ;
45
46
import org .springframework .data .repository .Repository ;
46
47
import org .springframework .data .util .Streamable ;
@@ -120,7 +121,7 @@ void convertsRxJavaSingleIntoPublisher() throws Exception {
120
121
assertThat (result ).isInstanceOf (Publisher .class );
121
122
122
123
Mono <Entity > mono = Mono .from ((Publisher <Entity >) result );
123
- assertThat (mono .block ()).isEqualTo (entity .toBlocking (). value ());
124
+ assertThat (mono .block ()).isEqualTo (entity .blockingGet ());
124
125
}
125
126
126
127
@ Test // DATACMNS-836
@@ -133,7 +134,7 @@ void convertsRxJavaSingleIntoMono() throws Exception {
133
134
assertThat (result ).isInstanceOf (Mono .class );
134
135
135
136
Mono <Entity > mono = (Mono <Entity >) result ;
136
- assertThat (mono .block ()).isEqualTo (entity .toBlocking (). value ());
137
+ assertThat (mono .block ()).isEqualTo (entity .blockingGet ());
137
138
}
138
139
139
140
@ Test // DATACMNS-836
@@ -146,7 +147,7 @@ void convertsRxJavaSingleIntoFlux() throws Exception {
146
147
assertThat (result ).isInstanceOf (Flux .class );
147
148
148
149
Flux <Entity > flux = (Flux <Entity >) result ;
149
- assertThat (flux .next ().block ()).isEqualTo (entity .toBlocking (). value ());
150
+ assertThat (flux .next ().block ()).isEqualTo (entity .blockingGet ());
150
151
}
151
152
152
153
@ Test // DATACMNS-836
@@ -159,7 +160,7 @@ void convertsRxJavaObservableIntoPublisher() throws Exception {
159
160
assertThat (result ).isInstanceOf (Publisher .class );
160
161
161
162
Mono <Entity > mono = Mono .from ((Publisher <Entity >) result );
162
- assertThat (mono .block ()).isEqualTo (entity .toBlocking (). first ());
163
+ assertThat (mono .block ()).isEqualTo (entity .blockingFirst ());
163
164
}
164
165
165
166
@ Test // DATACMNS-836
@@ -172,7 +173,7 @@ void convertsRxJavaObservableIntoMono() throws Exception {
172
173
assertThat (result ).isInstanceOf (Mono .class );
173
174
174
175
Mono <Entity > mono = (Mono <Entity >) result ;
175
- assertThat (mono .block ()).isEqualTo (entity .toBlocking (). first ());
176
+ assertThat (mono .block ()).isEqualTo (entity .blockingFirst ());
176
177
}
177
178
178
179
@ Test // DATACMNS-836
@@ -185,7 +186,7 @@ void convertsRxJavaObservableIntoFlux() throws Exception {
185
186
assertThat (result ).isInstanceOf (Flux .class );
186
187
187
188
Flux <Entity > flux = (Flux <Entity >) result ;
188
- assertThat (flux .next ().block ()).isEqualTo (entity .toBlocking (). first ());
189
+ assertThat (flux .next ().block ()).isEqualTo (entity .blockingFirst ());
189
190
}
190
191
191
192
@ Test // DATACMNS-836
@@ -198,7 +199,7 @@ void convertsRxJavaObservableIntoSingle() throws Exception {
198
199
assertThat (result ).isInstanceOf (Single .class );
199
200
200
201
Single <Entity > single = (Single <Entity >) result ;
201
- assertThat (single .toBlocking (). value ()) .isEqualTo (entity .toBlocking (). first ());
202
+ assertThat (single .blockingGet ()) .isEqualTo (entity .blockingFirst ());
202
203
}
203
204
204
205
@ Test // DATACMNS-836
@@ -211,7 +212,7 @@ void convertsRxJavaSingleIntoObservable() throws Exception {
211
212
assertThat (result ).isInstanceOf (Observable .class );
212
213
213
214
Observable <Entity > observable = (Observable <Entity >) result ;
214
- assertThat (observable .toBlocking (). first ()) .isEqualTo (entity .toBlocking (). value ());
215
+ assertThat (observable .blockingFirst ()) .isEqualTo (entity .blockingGet ());
215
216
}
216
217
217
218
@ Test // DATACMNS-836
@@ -224,7 +225,7 @@ void convertsReactorMonoIntoSingle() throws Exception {
224
225
assertThat (result ).isInstanceOf (Single .class );
225
226
226
227
Single <Entity > single = (Single <Entity >) result ;
227
- assertThat (single .toBlocking (). value ()).isEqualTo (entity .block ());
228
+ assertThat (single .blockingGet ()).isEqualTo (entity .block ());
228
229
}
229
230
230
231
@ Test // DATACMNS-836
@@ -237,7 +238,7 @@ void convertsReactorMonoIntoCompletable() throws Exception {
237
238
assertThat (result ).isInstanceOf (Completable .class );
238
239
239
240
Completable completable = (Completable ) result ;
240
- assertThat ( completable .get ()). isNull ();
241
+ completable .blockingAwait ();
241
242
}
242
243
243
244
@ Test // DATACMNS-836
@@ -250,7 +251,7 @@ void convertsReactorMonoIntoCompletableWithException() throws Exception {
250
251
assertThat (result ).isInstanceOf (Completable .class );
251
252
252
253
Completable completable = (Completable ) result ;
253
- assertThat ( completable . get ()). isInstanceOf ( InvalidDataAccessApiUsageException . class );
254
+ assertThatExceptionOfType ( InvalidDataAccessApiUsageException . class ). isThrownBy ( completable :: blockingAwait );
254
255
}
255
256
256
257
@ Test // DATACMNS-836
@@ -290,7 +291,7 @@ void convertsReactorMonoIntoObservable() throws Exception {
290
291
assertThat (result ).isInstanceOf (Observable .class );
291
292
292
293
Observable <Entity > observable = (Observable <Entity >) result ;
293
- assertThat (observable .toBlocking (). first ()).isEqualTo (entity .block ());
294
+ assertThat (observable .blockingFirst ()).isEqualTo (entity .block ());
294
295
}
295
296
296
297
@ Test // DATACMNS-836
@@ -303,7 +304,7 @@ void convertsReactorFluxIntoSingle() throws Exception {
303
304
assertThat (result ).isInstanceOf (Single .class );
304
305
305
306
Single <Entity > single = (Single <Entity >) result ;
306
- assertThat (single .toBlocking (). value ()).isEqualTo (entity .next ().block ());
307
+ assertThat (single .blockingGet ()).isEqualTo (entity .next ().block ());
307
308
}
308
309
309
310
@ Test // DATACMNS-836
@@ -316,7 +317,7 @@ void convertsReactorFluxIntoObservable() throws Exception {
316
317
assertThat (result ).isInstanceOf (Observable .class );
317
318
318
319
Observable <Entity > observable = (Observable <Entity >) result ;
319
- assertThat (observable .toBlocking (). first ()).isEqualTo (entity .next ().block ());
320
+ assertThat (observable .blockingFirst ()).isEqualTo (entity .next ().block ());
320
321
}
321
322
322
323
@ Test // DATACMNS-836
0 commit comments