VulnerableApp icon indicating copy to clipboard operation
VulnerableApp copied to clipboard

Add unit tests for Blind SQL Injection Vulnerability levels 1, 2, and 3

Open imertetsu opened this issue 1 year ago • 8 comments

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

imertetsu avatar Oct 01 '24 21:10 imertetsu

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

preetkaran20 avatar Oct 02 '24 17:10 preetkaran20

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

imertetsu avatar Oct 02 '24 22:10 imertetsu

@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 avatar Oct 02 '24 23:10 preetkaran20

@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

preetkaran20 avatar Oct 02 '24 23:10 preetkaran20

@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

imertetsu avatar Oct 03 '24 02:10 imertetsu

@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 avatar Oct 04 '24 20:10 preetkaran20

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

preetkaran20 avatar Oct 04 '24 20:10 preetkaran20

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

imertetsu avatar Oct 05 '24 15:10 imertetsu

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

preetkaran20 avatar Nov 10 '24 01:11 preetkaran20