Why new entity is saved with null field value when annotation tells that the value cannot be null?

I am trying to do JUnit test and save new Book and Category. However one of the fields cannot be null. O r I think it should be like this. To achieve this I use annotation
@NonNull
. But actually the entity is still saved with
NULL
value. Can you tell me why? And can you tell me what to do so Null value fields could not be saved and instead Spring would show an exception?
View:
Eclipse-Book-JunitTest-Result.jpg
MariaDB-MySql-pic1.png
Was this page helpful?