File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
spring-boot-project/spring-boot-actuator/src
main/java/org/springframework/boot/actuate/metrics/web/reactive/server
test/java/org/springframework/boot/actuate/metrics/web/reactive/server Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 22
22
23
23
import org .springframework .boot .actuate .metrics .http .Outcome ;
24
24
import org .springframework .http .HttpStatus ;
25
- import org .springframework .http .server .reactive .AbstractServerHttpResponse ;
26
25
import org .springframework .http .server .reactive .ServerHttpResponse ;
27
26
import org .springframework .util .StringUtils ;
28
27
import org .springframework .web .reactive .HandlerMapping ;
@@ -164,11 +163,9 @@ public static Tag outcome(ServerWebExchange exchange) {
164
163
165
164
private static Integer extractStatusCode (ServerWebExchange exchange ) {
166
165
ServerHttpResponse response = exchange .getResponse ();
167
- if (response instanceof AbstractServerHttpResponse ) {
168
- Integer statusCode = ((AbstractServerHttpResponse ) response ).getStatusCodeValue ();
169
- if (statusCode != null ) {
170
- return statusCode ;
171
- }
166
+ Integer statusCode = response .getRawStatusCode ();
167
+ if (statusCode != null ) {
168
+ return statusCode ;
172
169
}
173
170
HttpStatus status = response .getStatusCode ();
174
171
return (status != null ) ? status .value () : null ;
Original file line number Diff line number Diff line change 21
21
import org .junit .jupiter .api .Test ;
22
22
23
23
import org .springframework .http .HttpStatus ;
24
- import org .springframework .http .server .reactive .AbstractServerHttpResponse ;
25
24
import org .springframework .http .server .reactive .ServerHttpRequest ;
25
+ import org .springframework .http .server .reactive .ServerHttpResponse ;
26
26
import org .springframework .mock .http .server .reactive .MockServerHttpRequest ;
27
27
import org .springframework .mock .web .server .MockServerWebExchange ;
28
28
import org .springframework .web .reactive .HandlerMapping ;
@@ -123,9 +123,9 @@ void outcomeTagIsSuccessWhenResponseStatusIsNull() {
123
123
void outcomeTagIsSuccessWhenResponseStatusIsAvailableFromUnderlyingServer () {
124
124
ServerWebExchange exchange = mock (ServerWebExchange .class );
125
125
ServerHttpRequest request = mock (ServerHttpRequest .class );
126
- AbstractServerHttpResponse response = mock (AbstractServerHttpResponse .class );
126
+ ServerHttpResponse response = mock (ServerHttpResponse .class );
127
127
given (response .getStatusCode ()).willReturn (HttpStatus .OK );
128
- given (response .getStatusCodeValue ()).willReturn (null );
128
+ given (response .getRawStatusCode ()).willReturn (null );
129
129
given (exchange .getRequest ()).willReturn (request );
130
130
given (exchange .getResponse ()).willReturn (response );
131
131
Tag tag = WebFluxTags .outcome (exchange );
You can’t perform that action at this time.
0 commit comments