Feature request: no nulls by default.
See original GitHub issueIn scala code null
is rarely used in favour instead of Option.None
or for collections an empty collection. As a result the actual code is not checking or expecting null.
This doesn’t play well with mockito which returns nulls by default for non-stubbed methods, is it possible to somehow wire up something to change this behaviour inside this framework itself.
So it could default for e.g. any Option[T]
into None
, List[T]
into Nil
, etc.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Prevent a custom property from being saved without a default value ...
Prevent a custom property from being saved without a default value (no NULLS allowed). Feature Request to the Orion custom property editor prevent...
Read more >[Feature Request] Allow Nulls for Optional Fields #266 - GitHub
Create a collection with optional fields. Upload some documents where those fields are null rather than non-existent. Observe the following ...
Read more >Default Request Types (Now Available in the Featur...
We are excited to "Default Request Types", a new feature that will ensure that issues no longer lose their Request Type when they...
Read more >Boolean field defaults: `null` vs `false`? - DatoCMS community
On boolean fields, is it possible to configure the default value to be false instead of null if it's never been touched?
Read more >Constructor parameter default value when receiving null input ...
In this case, I will only get my default value if the parameter is not specified at all, but if the input to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For the empty defaults, that’s exactly what we have now, check this test
https://github.com/mockito/mockito-scala/pull/30/files#diff-757050a165ef4dd5d1090f1e22959dc9R128
I’m going to add wrappers for DEEP_STUBS and the others so they can be easily composable
Thanks for raising this, I’m actually working on it already 😃
Keep tuned