From 9cafb63301b6e73efa16b877f0729eef0751f72e Mon Sep 17 00:00:00 2001 From: Topher Lamey Date: Wed, 11 May 2022 10:07:17 -0600 Subject: [PATCH] More tests --- .../PathTraversalCheckApplicationTests.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/kotlin/com/stackhawk/pathtraversalcheck/PathTraversalCheckApplicationTests.kt b/src/test/kotlin/com/stackhawk/pathtraversalcheck/PathTraversalCheckApplicationTests.kt index 6748676..abec753 100644 --- a/src/test/kotlin/com/stackhawk/pathtraversalcheck/PathTraversalCheckApplicationTests.kt +++ b/src/test/kotlin/com/stackhawk/pathtraversalcheck/PathTraversalCheckApplicationTests.kt @@ -47,7 +47,13 @@ class PathTraversalCheckApplicationTests(@Autowired val mockMvc: MockMvc) { } @Test - fun `test paths`() { + fun `test intentional vulnerability file`() { + mockMvc.perform(MockMvcRequestBuilders.get("/file?filePath=/etc/passwd")) + .andExpect(MockMvcResultMatchers.status().isOk) + } + + @Test + fun `test file check`() { getPath("/hello", HttpStatus.OK) getPath("/../usr_content.bak/hello", HttpStatus.INTERNAL_SERVER_ERROR)