Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return an empty String instead of null when creating a mock #373

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Return an empty String instead of null when creating a mock #373

wants to merge 2 commits into from

Conversation

jordigarcl
Copy link

@jordigarcl jordigarcl commented Jan 15, 2020

See #372 for reference

I believe String values in mocks should return "" by default.

It is a historically 'special' type which has always had some special 'primitive-like' privileges.
I assume people expect it to return a nice value as well!

Thank you for submitting a pull request! But first:

I believe `String` values in mocks should return `""` by default.
It is a historically 'special' type which has always had some special 'primitive-like' privileges. 
I assume people expect it to return a nice value as well!
@jordigarcl
Copy link
Author

Has this PR been reviewed yet?

Base automatically changed from 2.x to main January 18, 2021 03:46
@nhaarman nhaarman removed their request for review September 27, 2021 07:01
@wesalvaro
Copy link
Contributor

What does plain Mockito do?

@wesalvaro
Copy link
Contributor

Plain Mockito returns null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants