You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to test how the service reacts on unknown HTTP response codes like 222. So I created a service that responds with HTTP status 222 and tried to test it:
java.lang.IllegalArgumentException: No matching constant for [222]
at org.springframework.http.HttpStatus.valueOf(HttpStatus.java:547)
at org.springframework.http.client.reactive.ReactorClientHttpResponse.getStatusCode(ReactorClientHttpResponse.java:139)
at org.springframework.http.client.reactive.ClientHttpResponseDecorator.getStatusCode(ClientHttpResponseDecorator.java:60)
at org.springframework.test.web.reactive.server.ExchangeResult.getStatus(ExchangeResult.java:176)
at org.springframework.test.web.reactive.server.ExchangeResult.toString(ExchangeResult.java:251)
at java.base/java.lang.String.valueOf(String.java:4218)
at java.base/java.lang.StringBuilder.append(StringBuilder.java:173)
at org.springframework.test.web.reactive.server.ExchangeResult.assertWithDiagnostics(ExchangeResult.java:236)
at org.springframework.test.web.reactive.server.DefaultWebTestClient$DefaultBodySpec.isEqualTo(DefaultWebTestClient.java:554)
at de.gdvdl.tgic.tgicwebauth.routes.WebapiTest.test222(ResponseTest:xyz)
The issue seems to be at org.springframework.test.web.reactive.server.ExchangeResult.toString(), which assumes that getStatus() is always available:
Affects: spring-test:5.3.23
I wanted to test how the service reacts on unknown HTTP response codes like 222. So I created a service that responds with HTTP status 222 and tried to test it:
The result was an Exception with Stack Trace:
The issue seems to be at
org.springframework.test.web.reactive.server.ExchangeResult.toString()
, which assumes thatgetStatus()
is always available:So the line could be something like this:
with
The text was updated successfully, but these errors were encountered: