I am migrating some integration tests from gradle to bazel for an application. As part of the integration test a resource is loaded like
final String resourcePath = SomeClass.class.getResource("/test.properties").getPath()
If I trace this code path, when I run this test from IntelliJ, for gradle, this path is an absolute path like
/Users/me/..../test.properties
However, in the case of bazel, it looks something like
file:/private/var/tmp/_bazel_me/4f1994ece960b360388a372b5e6aa4b2/execroot/project/bazel-out/darwin-fastbuild/bin/project/src/integrationTest/package/Test.jar!/test.properties
So this string resourcePath is provided to a framework that loads with
Files.exists(resourcePath)
This works for the absolute path but not for the jar based path. How do I get around this since I don't have any control over the framework code?