Skip to content

Provide access to non-standard status codes from ExchangeResult #23630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wilkinsona opened this issue Sep 12, 2019 · 1 comment
Closed

Provide access to non-standard status codes from ExchangeResult #23630

wilkinsona opened this issue Sep 12, 2019 · 1 comment
Assignees
Labels
in: test Issues in the test module in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task
Milestone

Comments

@wilkinsona
Copy link
Member

Similar to #22872 and #23547 it would be useful for ExchangeResult to provide support for and access to non-standard status codes as an int.

@wilkinsona
Copy link
Member Author

wilkinsona commented Sep 12, 2019

To illustrate the current situation, the following test will fail:

WebTestClient
	.bindToRouterFunction(
		RouterFunctions.route(GET("/customStatus"), (req) -> ServerResponse.status(600).build()))
	.build().get().uri("/customStatus").exchange().expectStatus().isEqualTo(600);

The status is actually 200 due to the null returned by HttpStatus.resolve(int) then being mapped to HttpStatus.OK.

Edit: looks like @poutsma is day ahead of me for this part of the problem (#23599). Although, that said, an exception is now thrown for statuses < 100 or >= 600. I've commented on #23599 with more details.

@rstoyanchev rstoyanchev self-assigned this Sep 24, 2019
@rstoyanchev rstoyanchev added in: test Issues in the test module in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 24, 2019
@rstoyanchev rstoyanchev added this to the 5.1.10 milestone Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task
Projects
None yet
Development

No branches or pull requests

3 participants