spring-projects / spring-projects/spring-data-commons
org.springframework.data.domain.PageImpl's toString [DATACMNS-1640]
Open
@mp911de is already working on this.
Since Mar 15, 2021.
for: team-attention
in: core
type: enhancement
- Dominant language
- Java
- Stars
- 838
- Forks
- 730
- PR merge metrics
- No merged PRs in 30d
Description
Patrik Mihalcin opened DATACMNS-1640 and commented
toString implementation of PageImpl class doesn't include content.
Given I have this test written in Groovy:
import static java.util.Arrays.asList
import org.junit.Test
import org.springframework.data.domain.PageImpl
import org.springframework.data.domain.PageRequest
class PageTest {
@Test
void "different content, toString representation doesn't indicate it"() {
Page<String> page1 = new PageImpl<>(asList("item1", "item2"), new PageRequest(0, 5), 10)
Page<String> page2 = new PageImpl<>(asList("item1", "item3"), new PageRequest(0, 5), 10)
assert page1 == page2
}
}
The error is reported as follows:
Assertion failed:
assert page1 == page2
| | |
| | Page 1 of 2 containing java.lang.String instances
| false
Page 1 of 2 containing java.lang.String instances
The same toString representation for different pages
No further details from DATACMNS-1640
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.