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

Poor comparison for ContentRequestMatchers#bytes [SPR-14281] #18853

Closed
spring-projects-issues opened this issue May 17, 2016 · 1 comment
Closed
Assignees
Labels
in: test Issues in the test module type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

James Howe opened SPR-14281 and commented

This request matcher uses assertEquals instead of something like JUnit's assertArrayEquals.
Because of this, the output on failure is

java.lang.AssertionError: Request content 
Expected :[B@7976d382
Actual   :[B@59f36439

Instead of showing the actual difference between the arrays.


Reference URL: https://github.com/spring-projects/spring-framework/blob/master/spring-test/src/main/java/org/springframework/test/web/client/match/ContentRequestMatchers.java#L141

Referenced from: commits 822e40e

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

As of 4.3, we're exposing ObjectUtils.nullSafeToString results there, in sync with the ObjectUtils.nullSafeEquals check for the actual comparison: For arrays, that implies a list-like representation of the elements.

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 type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants