diff --git a/src/main/java/uk/gov/beis/els/controller/StaticContentController.java b/src/main/java/uk/gov/beis/els/controller/StaticContentController.java index f0c5c8bb..d0d7f632 100644 --- a/src/main/java/uk/gov/beis/els/controller/StaticContentController.java +++ b/src/main/java/uk/gov/beis/els/controller/StaticContentController.java @@ -44,4 +44,10 @@ public String printHeaders(@RequestHeader Map headers) { return "OK"; } + @GetMapping(value = "/throw-error") + @ResponseBody + public String throwError() { + throw new RuntimeException("Example error"); + } + } diff --git a/src/test/java/uk/gov/beis/els/ControllerSmokeTest.java b/src/test/java/uk/gov/beis/els/ControllerSmokeTest.java index 9d6260f6..82460215 100644 --- a/src/test/java/uk/gov/beis/els/ControllerSmokeTest.java +++ b/src/test/java/uk/gov/beis/els/ControllerSmokeTest.java @@ -1,8 +1,5 @@ package uk.gov.beis.els; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -22,6 +19,9 @@ import org.springframework.web.context.WebApplicationContext; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @TestPropertySource(properties = { @@ -48,7 +48,8 @@ public void abstractSetUp() { ignoredEndpointPrefixes = Arrays.asList( "/swagger-ui.html", - "/api-documentation"); + "/api-documentation", + "/throw-error"); }