Skip to content

Commit

Permalink
Add temporary throw error endpoint for PaaS testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbarnett91 committed Nov 30, 2023
1 parent 0aca458 commit 8b80981
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ public String printHeaders(@RequestHeader Map<String, String> headers) {
return "OK";
}

@GetMapping(value = "/throw-error")
@ResponseBody
public String throwError() {
throw new RuntimeException("Example error");
}

}
9 changes: 5 additions & 4 deletions src/test/java/uk/gov/beis/els/ControllerSmokeTest.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 = {
Expand All @@ -48,7 +48,8 @@ public void abstractSetUp() {

ignoredEndpointPrefixes = Arrays.asList(
"/swagger-ui.html",
"/api-documentation");
"/api-documentation",
"/throw-error");

}

Expand Down

0 comments on commit 8b80981

Please sign in to comment.