spring 환경의 Unit Test 에서 exception 을 테스트 할 때, MVC 패턴에서 exception 핸들러를 사용하고 있고, 특정 exception 에 대해 테스트 하고 싶다면 해당 선언을 해주면 된다.

.andExpect(result -> assertTrue(result.getResolvedException() instanceof WhateverException))

참고

Exception Handler in Spring MVC
Testing Exceptions with Spring MockMvc