How to test if JSON path does not include a specific element, or if the element is present it is null?

I had the same problem with the newer version. It looks to me that the doesNotExist() function will verify that the key is not in the result:

.andExpect(jsonPath("$.password").doesNotExist())

Leave a Comment