Skip to content

Commit

Permalink
Use Thread Context ClassLoader to find test resources
Browse files Browse the repository at this point in the history
  • Loading branch information
holly-cummins authored and rholshausen committed Nov 24, 2022
1 parent 3690335 commit 6f3c422
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class PactFolderLoader<I> : PactLoader where I : Interaction {
override fun getPactSource() = this.pactSource

private fun resolvePath(): File {
val resourcePath = PactFolderLoader::class.java.classLoader.getResource(path.path)
val resourcePath = Thread.currentThread().getContextClassLoader().getResource(path.path)
return if (resourcePath != null) {
File(URLDecoder.decode(resourcePath.path, "UTF-8"))
} else {
Expand Down

0 comments on commit 6f3c422

Please sign in to comment.