An interaction on a null object shall report an exception to the user, that the interaction does not make sense.
This shall help users to detect such interactions, which will work as intended.
This is a breaking change, because previously such interactions are silent, although probably senseless.
class TestSpec extends Specification {
def "Interaction on null Object shall report error"() {
given:
Object nullObj = null
when:
nullObj .toString() >> ""
then:
def ex = thrown(IllegalArgumentException)
ex.message == "Interaction on null object is invalid. TODO message"
}
}
An interaction on a
nullobject shall report an exception to the user, that the interaction does not make sense.This shall help users to detect such interactions, which will work as intended.
This is a breaking change, because previously such interactions are silent, although probably senseless.