-
Notifications
You must be signed in to change notification settings - Fork 594
Unirest.config() is null #540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There are a few strange things here.
|
I apologize for the confusion. I originally was using version 3.14.5 and was getting this error. I upgraded to the latest version v4.4.5 to try and fix this error and I still got the same error and that's when I copied the Null Pointer Exception. I have verified there is only one version of Unirest being imported by my application. I currently have reverted it back to version 3.14.5. I did some more debugging and figured out this behavior occurs exclusively in my unit tests in the methods I'm calling |
are you using a mocking framework? Including the Unirest mocking library? |
When trying to set the cookie specs with the line:
Unirest.config().cookieSpec(CookieSpecs.STANDARD)
I receive the error:java.lang.NullPointerException: Cannot invoke "kong.unirest.core.Config.cookieSpec(java.lang.String)" because the return value of "kong.unirest.core.Unirest.config()" is null.
I can't find any mention online of anyone else having this error and the docs show this is how you edit the config so I'm not sure what I'm doing wrong in this case.
build.gradle.kts
file has this import although I've gotten this error with the most recent version v4.4.5 as well :implementation("com.konghq:unirest-java:3.14.5")
import kong.unirest.Unirest
Unirest.config()
will return null.The text was updated successfully, but these errors were encountered: