lundi 1 mars 2021

Why .isNotNull(); assertions fails even though I have a controller class?

I am new to Spring Boot and testing. I am currently studying from baeldung's tutorial (https://spring.io/guides/gs/testing-web/) and I bumped into this error.

enter image description here

In fact, it passes when I use isNull() method. But I don't understand this because my controller class has mappings and all that. Why would it be null?

This is my controller class

enter image description here

Or maybe this is not how this test is supposed to be done? But they show it as follows in baeldung

enter image description here

Any help is appreciated.

Best,

Aucun commentaire:

Enregistrer un commentaire