When running the test file on my IDE on my local machine, I added the self-signed certificate to my JVM truststore by navigating to $JAVA_HOME/jre/lib/security and adding it using keytool. The error went away.
When I try the build on Jenkins, I get the same error again: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I'm trying to figure out how I would add the SSL cert path in Jenkins. If I run the commands in the pre-build steps, it doesn't work because adding a ssl cert requires the keystore password, and I'm not sure if there's a way to indicate what password you'd want to enter prior to running the pre-build steps.