File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
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 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 2222
2323import org .springframework .boot .actuate .metrics .http .Outcome ;
2424import org .springframework .http .HttpStatus ;
25- import org .springframework .http .server .reactive .AbstractServerHttpResponse ;
2625import org .springframework .http .server .reactive .ServerHttpResponse ;
2726import org .springframework .util .StringUtils ;
2827import org .springframework .web .reactive .HandlerMapping ;
@@ -164,11 +163,9 @@ public static Tag outcome(ServerWebExchange exchange) {
164163
165164 private static Integer extractStatusCode (ServerWebExchange exchange ) {
166165 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 ;
172169 }
173170 HttpStatus status = response .getStatusCode ();
174171 return (status != null ) ? status .value () : null ;
Original file line number Diff line number Diff line change 2323import org .springframework .http .HttpStatus ;
2424import org .springframework .http .server .reactive .AbstractServerHttpResponse ;
2525import org .springframework .http .server .reactive .ServerHttpRequest ;
26+ import org .springframework .http .server .reactive .ServerHttpResponse ;
2627import org .springframework .mock .http .server .reactive .MockServerHttpRequest ;
2728import org .springframework .mock .web .server .MockServerWebExchange ;
2829import org .springframework .web .reactive .HandlerMapping ;
@@ -123,9 +124,9 @@ void outcomeTagIsSuccessWhenResponseStatusIsNull() {
123124 void outcomeTagIsSuccessWhenResponseStatusIsAvailableFromUnderlyingServer () {
124125 ServerWebExchange exchange = mock (ServerWebExchange .class );
125126 ServerHttpRequest request = mock (ServerHttpRequest .class );
126- AbstractServerHttpResponse response = mock (AbstractServerHttpResponse .class );
127+ ServerHttpResponse response = mock (ServerHttpResponse .class );
127128 given (response .getStatusCode ()).willReturn (HttpStatus .OK );
128- given (response .getStatusCodeValue ()).willReturn (null );
129+ given (response .getRawStatusCode ()).willReturn (null );
129130 given (exchange .getRequest ()).willReturn (request );
130131 given (exchange .getResponse ()).willReturn (response );
131132 Tag tag = WebFluxTags .outcome (exchange );
Original file line number Diff line number Diff line change @@ -1608,7 +1608,7 @@ bom {
16081608 ]
16091609 }
16101610 }
1611- library(" Spring Framework" , " 5.2.3.RELEASE " ) {
1611+ library(" Spring Framework" , " 5.2.4.BUILD-SNAPSHOT " ) {
16121612 group(" org.springframework" ) {
16131613 imports = [
16141614 " spring-framework-bom"
You can’t perform that action at this time.
0 commit comments