@Test
    void testTriggerException() throws Exception {
        mockMvc.perform(get("/oups"))
            .andExpect(view().name("exception"))
            .andExpect(model().attributeExists("exception"))
            .andExpect(forwardedUrl("exception"))
            .andExpect(status().isOk());
    }
Test class for {@link CrashController}

@author Colin But
src/test/java/org/springframework/samples/petclinic/web/CrashControllerTests.java