Skip to content
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

Make MockRestServiceServer error messages more descriptive [SPR-12230] #16845

Closed
spring-projects-issues opened this issue Sep 21, 2014 · 3 comments
Assignees
Labels
in: test Issues in the test module status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Sep 21, 2014

Elnur Abdurrakhimov opened SPR-12230 and commented

Currently, when making an unexpected request to the mock server, I get an exception java.lang.AssertionError: No further requests expected.

It's a real pain to find out which request is at fault, because there is not enough information in that exception's stacktrace.

It would be really helpful to have all the expected requests, that were already done, to be displayed. It should also display which request was expected next and which one came instead and caused the expectations to fail.


Affects: 3.2 GA

Issue Links:

Backported to: 4.0.8, 3.2.12

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

This exception is an indication that all expected requests were created. In other words there is no next request expected. We could of course print all executed requests so far but that's identical to the requests set up as expectations in the test.

@spring-projects-issues
Copy link
Collaborator Author

daniel carter commented

I guess the key part is "which one came in instead". i.e. what was the request that was not expected.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Right, that one we should log. I imagine the stack is probably good enough in many cases unless requests are created in a loop?

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 status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants