Can testkit use paths through configuration?

I want to write some tests like this:

But test-kit use hardcoded paths here:

and here:

That force me make test-source locating root of working directory, and directory name should be the same.

Can it reading paths from configuration and leave current paths as default? This package will be helpful and no breaking changes.

Hi Yeoleobun,

You should not use the mainCodeSourcesPath method, because it builds a path in ../java-checks-test-sources/src/main/java/.... You can provide a String with your own way to reference the file. ex:

    CheckVerifier.newVerifier()
      .onFile("src/test/resources/checks/aws/AwsConsumerBuilderUsageCheck.java")
      .withCheck(new AwsConsumerBuilderUsageCheck())
      .verifyIssues();

You can also override the DEFAULT_CLASSPATH using withClassPath(Collection<File> classpath) targeting your dependency jars.

Good luck,

Alban

Thanks, your reply is really helpful.