Add test for PathTraversal class#456
Conversation
|
Can I ask you to check if the tests are done correctly? Thank you. :) |
| assertEquals(HttpStatus.OK, response.getStatusCode()); | ||
| } | ||
| @Test | ||
| void testGetVulnerablePayloadLevel2WithNullFileName() throws URISyntaxException { |
There was a problem hiding this comment.
@richard66033 can you please use other conditions for test instead of just Null like ../ is there in level 1 and it passes the test but if ../ is there in second level, it will not allow it. Similarly .. and %2f are not there in level 4 and so on.
| import static org.junit.jupiter.api.Assertions.*; | ||
|
|
||
|
|
||
| class PathTraversalVulnerabilityTest { |
There was a problem hiding this comment.
Please run ./gradlew spotlessApply this will fix the indentation and will pass the CI/CD pipeline.
|
Hi @preetkaran20, I add more tests with conditions like |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #456 +/- ##
=========================================
Coverage ? 23.15%
Complexity ? 206
=========================================
Files ? 55
Lines ? 1831
Branches ? 196
=========================================
Hits ? 424
Misses ? 1365
Partials ? 42 ☔ View full report in Codecov by Sentry. |
|
Hi @richard66033 , Thanks a lot for the PR ❤️ |

No description provided.