Today when I was doing JUnit testing on MySQL, I found that codes similar to assertNull(tu) didn’t know what they meant, so I summarized them as follows.
org.springframework.util.Assert
Assert is translated into Chinese as "assertion".
Roughly speaking, it means to conclude that a certain actual value is what you expect, and if it is different, then Throws an exception.
spring source code is as follows:
/**
* Assert that an object is not null
.
*
Assert.notNull(clazz, "The class must not be null");
null
The meaning of this function is that the incoming object must not be empty. Throws an exception if it is empty.
The above is the detailed content of JAVA--assert.notNull. For more information, please follow other related articles on the PHP Chinese website!