Skip to content
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 unit tests for Blind SQL Injection Vulnerability levels 1, 2, and 3 #474

Merged

Conversation

imertetsu
Copy link
Contributor

This PR adds unit tests for the Blind SQL Injection Vulnerability for levels 1, 2, and 3 in the BlindSQLInjectionVulnerability class. The tests mock the JdbcTemplate and ResultSet to simulate SQL queries and responses.

Changes:

  • Added unit tests for getCarInformationLevel1():
  • Added unit tests for getCarInformationLevel2():
  • Added unit tests for getCarInformationLevel3():

Tests:

All tests passed successfully.

Resolves: #392

@preetkaran20
Copy link
Member

@imertetsu there are a few checkstyle errors. please run ./gradlew :spotlessApply to fix these violations.

@preetkaran20 preetkaran20 self-requested a review October 2, 2024 17:24
@imertetsu
Copy link
Contributor Author

Hi @preetkaran20 I'm having this issue when trying to execute the command ./gradlew :spotlessApply I'm not pretty sure how to fix it, I was trying to use another code formatter like googleJavaFormat('1.7') for testing purposes and it worked but with googleJavaFormat().aosp() I'm having this issue, I'm still figuring out but if you have any suggestion it'd amazing :)
image

image

I've also added this configuration to idea64.exe.vmoptions file, but I'm using Java8, so I shouldn't have that restriction
image

@preetkaran20
Copy link
Member

preetkaran20 commented Oct 2, 2024

@imertetsu try .\gradlew spotlessApply and also may be you are using java version different then the expected one.
what is the java version you are using?

@preetkaran20
Copy link
Member

@imertetsu try .\gradlew spotlessApply and also may be you are using java version different then the expected one. what is the java version you are using?

I tried fixing it. Let's see if it succeeds

@imertetsu
Copy link
Contributor Author

@preetkaran20 I'm using Java 8, let me know if it's correct, please. And why does the check still fail if you fixed it? 🤔
image

@preetkaran20
Copy link
Member

preetkaran20 commented Oct 4, 2024

@preetkaran20 I'm using Java 8, let me know if it's correct, please. And why does the check still fail if you fixed it? 🤔

I used java 22 and i think that is why it failed.

@preetkaran20
Copy link
Member

I have used Oracle java 8 locally and ran spotless apply and it worked.

@imertetsu
Copy link
Contributor Author

Alright! it worked for me as well! :) Now I'm able to run the command ./gradlew :spotlessApply thank you so much @preetkaran20

@preetkaran20 preetkaran20 merged commit 93ac7c6 into SasanLabs:master Nov 10, 2024
1 check passed
@preetkaran20
Copy link
Member

@imertetsu Thanks a lot for the PR !!! Great work !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add unit tests for Blind Sql Injection Vulnerability
2 participants