Open
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