When there's some object with a boxed type property, the getter of the property returns 0
. But this should return null
, because the default value of the boxed type property is null
. What is the problem here?
class Person {
private Long id;
public Long getId() {
return id;
}
}
...
@Mock Person person;
...
person.getId(); // 0 instead of null
That's simply the chosen default value for primitive and wrapper types in the default Mockito answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With