Skip to content

org.springframework.data.domain.PageImpl's toString [DATACMNS-1640] #2066

Open
@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

for: team-attentionAn issue we need to discuss as a team to make progressin: coreIssues in core supporttype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions