Skip to content
New issue

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

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

Already on GitHub? # 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:

Sorry, something went wrong.

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 jordigarcl requested a review from nhaarman February 9, 2020 18:33
@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.

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

Successfully merging this pull request may close these issues.

2 participants