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

Activity

added a commit that references this issue on Mar 4, 2021
3af13c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Participants

    @odrotbohm@mp911de@spring-projects-issues

    Issue actions

      org.springframework.data.domain.PageImpl's toString [DATACMNS-1640] · Issue #2066 · spring-projects/spring-data-commons