@@ -349,11 +349,11 @@ public void required_spec213_onSubscribe_mustThrowNullPointerExceptionWhenParame
349
349
public void run (WhiteboxTestStage stage ) throws Throwable {
350
350
351
351
{
352
- final Subscriber <T > sub = createSubscriber ( stage .probe () );
352
+ final Subscriber <? super T > sub = stage .sub ( );
353
353
boolean gotNPE = false ;
354
354
try {
355
355
sub .onSubscribe (null );
356
- } catch (final NullPointerException expected ) {
356
+ } catch (final NullPointerException expected ) {
357
357
gotNPE = true ;
358
358
}
359
359
assertTrue (gotNPE , "onSubscribe(null) did not throw NullPointerException" );
@@ -370,17 +370,22 @@ public void required_spec213_onNext_mustThrowNullPointerExceptionWhenParametersA
370
370
public void run (WhiteboxTestStage stage ) throws Throwable {
371
371
372
372
final Subscription subscription = new Subscription () {
373
- @ Override public void request (final long elements ) {}
374
- @ Override public void cancel () {}
373
+ @ Override
374
+ public void request (final long elements ) {
375
+ }
376
+
377
+ @ Override
378
+ public void cancel () {
379
+ }
375
380
};
376
381
377
382
{
378
- final Subscriber <T > sub = createSubscriber ( stage .probe () );
383
+ final Subscriber <? super T > sub = stage .sub ( );
379
384
boolean gotNPE = false ;
380
385
sub .onSubscribe (subscription );
381
386
try {
382
387
sub .onNext (null );
383
- } catch (final NullPointerException expected ) {
388
+ } catch (final NullPointerException expected ) {
384
389
gotNPE = true ;
385
390
}
386
391
assertTrue (gotNPE , "onNext(null) did not throw NullPointerException" );
@@ -390,7 +395,7 @@ public void run(WhiteboxTestStage stage) throws Throwable {
390
395
}
391
396
});
392
397
}
393
-
398
+
394
399
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.13
395
400
@ Override @ Test
396
401
public void required_spec213_onError_mustThrowNullPointerExceptionWhenParametersAreNull () throws Throwable {
@@ -399,17 +404,22 @@ public void required_spec213_onError_mustThrowNullPointerExceptionWhenParameters
399
404
public void run (WhiteboxTestStage stage ) throws Throwable {
400
405
401
406
final Subscription subscription = new Subscription () {
402
- @ Override public void request (final long elements ) {}
403
- @ Override public void cancel () {}
407
+ @ Override
408
+ public void request (final long elements ) {
409
+ }
410
+
411
+ @ Override
412
+ public void cancel () {
413
+ }
404
414
};
405
415
406
416
{
407
- final Subscriber <T > sub = createSubscriber ( stage .probe () );
417
+ final Subscriber <? super T > sub = stage .sub ( );
408
418
boolean gotNPE = false ;
409
419
sub .onSubscribe (subscription );
410
420
try {
411
421
sub .onError (null );
412
- } catch (final NullPointerException expected ) {
422
+ } catch (final NullPointerException expected ) {
413
423
gotNPE = true ;
414
424
}
415
425
assertTrue (gotNPE , "onError(null) did not throw NullPointerException" );
0 commit comments