File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
spring-test/src/main/java/org/springframework/test/web/reactive/server Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 71
71
* @author Rossen Stoyanchev
72
72
* @author Sam Brannen
73
73
* @author Michał Rowicki
74
+ * @author Sebastien Deleuze
74
75
* @since 5.0
75
76
*/
76
77
class DefaultWebTestClient implements WebTestClient {
@@ -506,7 +507,14 @@ public <T> FluxExchangeResult<T> returnResult(Class<T> elementClass) {
506
507
507
508
@ Override
508
509
public <T > FluxExchangeResult <T > returnResult (ParameterizedTypeReference <T > elementTypeRef ) {
509
- Flux <T > body = this .response .bodyToFlux (elementTypeRef );
510
+ Flux <T > body ;
511
+ if (elementTypeRef .getType ().equals (Void .class )) {
512
+ this .response .releaseBody ().block ();
513
+ body = Flux .empty ();
514
+ }
515
+ else {
516
+ body = this .response .bodyToFlux (elementTypeRef );
517
+ }
510
518
return new FluxExchangeResult <>(this .exchangeResult , body );
511
519
}
512
520
You can’t perform that action at this time.
0 commit comments