Thanks @saberduck. I have tried using that but I will explore more on it.
I am writing custom rules to check the required file. So, When i write Junit to test, how to pass current project directory as input to Junit without Hard-coding ?
For Example,
I am wiriting Junit as below,
JavaCheckVerifier.verify("src/main/resources/sonar-project.properties", new PomFileIsMandatoryRule());
The highlighted one was the input, I am testing against one custom rule.
For my scenario to check file exits or not, How can I pass current directory or folder as input to test against custom rule(developed to check file existence).
@AnuragSanagapalli you will probably want to raise issue on project level then, you can use this method to test your rule org.sonar.java.checks.verifier.JavaCheckVerifier#verifyIssueOnProject