응답 값에 특정 필드가 없는지 테스트
목표 응답 값에 특정 필드의 값이 null이 아니라, 완전히 존재하지 않는지 검증이 필요했다. 해결 아래와 같이 json 경로를 쓰고, doesNotHaveJsonPath() 메서드로 테스트할 수 있다. .andExpect(jsonPath("$.keyToNull").doesNotHaveJsonPath())) doesNotExist는 해당 경로의 값이 null인 경우에도 통과되어 버린다. 참고 자료 https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/servlet/result/JsonPathResultMatchers.html