Skip to content

Add test case for defaultToString() in StringUtils#5723

Open
skonda33 wants to merge 19 commits into
junit-team:mainfrom
skonda33:siva2
Open

Add test case for defaultToString() in StringUtils#5723
skonda33 wants to merge 19 commits into
junit-team:mainfrom
skonda33:siva2

Conversation

@skonda33
Copy link
Copy Markdown

@skonda33 skonda33 commented Jun 2, 2026

Add test case for defaultToString method

I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

@Test
void defaultToStringChecks(){
assertEquals("null",defaultToString(null));
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't make sense to call this method "...Checks" if there is only a single check/assertion.

To remedy that, you could introduce an additional assertion analogous to the startsWith() check in nullSafeToStringForObjectWhoseToStringImplementationThrowsAnException().


In addition, the code is missing a space after the comma (",").

Did you run a full local build before submitting the PR?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed review comments.

@sbrannen sbrannen changed the title Add test case for defaultToString method Add test case for defaultToString() in StringUtils Jun 3, 2026
mpkorstanje and others added 18 commits June 3, 2026 11:44
…-team#5701)

Same as b5f1766, but for the
`InterceptingExecutableInvoker` specifically.

An interesting aspect of this API was that we open taken in nullable
values, wrap them in an `Optional`, pass them down the call chain and
then unwrap them later on. With JSpecify available this isn't necessary
at all and we can also remove this behavior.

Signed-off-by: siva kumar konda <skonda3@gmail.com>
…3.5.6 (junit-team#5704)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
…3.5.6 (junit-team#5705)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
This reverts commit 3500c83.

Signed-off-by: siva kumar konda <skonda3@gmail.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
This reverts commit 3500c83.

Signed-off-by: siva kumar konda <skonda3@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
…am#5707)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
…#5712)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
…eam#5715)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: siva kumar konda <skonda3@gmail.com>
…import statement

Signed-off-by: siva kumar konda <skonda3@gmail.com>
@skonda33 skonda33 requested a review from sbrannen June 3, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants