-
-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run ./gradlew spotlessApply
this will fix the indentation and will pass the CI/CD pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.