@ -1,5 +1,5 @@
/ *
* Copyright 2002 - 2015 the original author or authors .
* Copyright 2002 - 2016 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -32,6 +32,7 @@ import org.springframework.ui.ModelMap;
import org.springframework.web.reactive.HandlerResult ;
import org.springframework.web.reactive.result.ResolvableMethod ;
import org.springframework.web.server.ServerWebExchange ;
import org.springframework.web.server.UnsupportedMediaTypeStatusException ;
import org.springframework.web.server.adapter.DefaultServerWebExchange ;
import org.springframework.web.server.session.MockWebSessionManager ;
@ -102,25 +103,12 @@ public class InvocableHandlerMethodTests {
@Test
public void resolverThrowsException ( ) throws Exception {
InvocableHandlerMethod hm = handlerMethod ( "singleArg" ) ;
addResolver ( hm , Mono . error ( new IllegalState Exception( "boo" ) ) ) ;
addResolver ( hm , Mono . error ( new UnsupportedMediaTypeStatus Exception( "boo" ) ) ) ;
Mono < HandlerResult > mono = hm . invokeForRequest ( this . exchange , this . model ) ;
TestSubscriber . subscribe ( mono )
. assertError ( IllegalStateException . class )
. assertErrorMessage ( "Error resolving argument [0] of type [java.lang.String] " +
"on method [" + hm . getMethod ( ) . toGenericString ( ) + "]" ) ;
}
@Test
public void resolverWithErrorSignal ( ) throws Exception {
InvocableHandlerMethod hm = handlerMethod ( "singleArg" ) ;
addResolver ( hm , Mono . error ( new IllegalStateException ( "boo" ) ) ) ;
Mono < HandlerResult > mono = hm . invokeForRequest ( this . exchange , this . model ) ;
TestSubscriber . subscribe ( mono )
. assertError ( IllegalStateException . class )
. assertErrorMessage ( "Error resolving argument [0] of type [java.lang.String] " +
"on method [" + hm . getMethod ( ) . toGenericString ( ) + "]" ) ;
. assertError ( UnsupportedMediaTypeStatusException . class )
. assertErrorMessage ( "Request failure [status: 415, reason: \"boo\"]" ) ;
}
@Test