|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2015 the original author or authors. |
| 2 | + * Copyright 2002-2016 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
32 | 32 | import org.springframework.web.reactive.HandlerResult;
|
33 | 33 | import org.springframework.web.reactive.result.ResolvableMethod;
|
34 | 34 | import org.springframework.web.server.ServerWebExchange;
|
| 35 | +import org.springframework.web.server.UnsupportedMediaTypeStatusException; |
35 | 36 | import org.springframework.web.server.adapter.DefaultServerWebExchange;
|
36 | 37 | import org.springframework.web.server.session.MockWebSessionManager;
|
37 | 38 |
|
@@ -102,25 +103,12 @@ public void noMatchingResolver() throws Exception {
|
102 | 103 | @Test
|
103 | 104 | public void resolverThrowsException() throws Exception {
|
104 | 105 | InvocableHandlerMethod hm = handlerMethod("singleArg");
|
105 |
| - addResolver(hm, Mono.error(new IllegalStateException("boo"))); |
| 106 | + addResolver(hm, Mono.error(new UnsupportedMediaTypeStatusException("boo"))); |
106 | 107 | Mono<HandlerResult> mono = hm.invokeForRequest(this.exchange, this.model);
|
107 | 108 |
|
108 | 109 | TestSubscriber.subscribe(mono)
|
109 |
| - .assertError(IllegalStateException.class) |
110 |
| - .assertErrorMessage("Error resolving argument [0] of type [java.lang.String] " + |
111 |
| - "on method [" + hm.getMethod().toGenericString() + "]"); |
112 |
| - } |
113 |
| - |
114 |
| - @Test |
115 |
| - public void resolverWithErrorSignal() throws Exception { |
116 |
| - InvocableHandlerMethod hm = handlerMethod("singleArg"); |
117 |
| - addResolver(hm, Mono.error(new IllegalStateException("boo"))); |
118 |
| - Mono<HandlerResult> mono = hm.invokeForRequest(this.exchange, this.model); |
119 |
| - |
120 |
| - TestSubscriber.subscribe(mono) |
121 |
| - .assertError(IllegalStateException.class) |
122 |
| - .assertErrorMessage("Error resolving argument [0] of type [java.lang.String] " + |
123 |
| - "on method [" + hm.getMethod().toGenericString() + "]"); |
| 110 | + .assertError(UnsupportedMediaTypeStatusException.class) |
| 111 | + .assertErrorMessage("Request failure [status: 415, reason: \"boo\"]"); |
124 | 112 | }
|
125 | 113 |
|
126 | 114 | @Test
|
|
0 commit comments