Skip to content
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

io.restassured.internal.http.HttpResponseException: Bad Request #2520

Closed
anilemreciftci opened this issue Jul 28, 2021 · 4 comments
Closed

Comments

@anilemreciftci
Copy link

When i try to build and run the tests, it gives error for http status codes other than 200. Anyone knows the reason

Caused by: io.restassured.internal.http.HttpResponseException: Bad Request
at io.restassured.internal.http.HTTPBuilder.defaultFailureHandler(HTTPBuilder.java:626)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
at groovy.lang.MetaClassImpl.invokeMethodClosure(MetaClassImpl.java:1050)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1092)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
at groovy.lang.Closure.call(Closure.java:411)
at groovy.lang.Closure.call(Closure.java:427)

@wakaleo
Copy link
Member

wakaleo commented Jul 29, 2021

There's not really very much to go on here, and your stack trace doesn't show any Serenty code. Have you asked the RestAssured community?

@anilemreciftci
Copy link
Author

Actually the problem is I cloned the serenity project here: https://github.com/jacekzygiel/SerenityRestAssured and it is working with other people but not working for me, it is throwing exception when i try to catch http status codes other than 200

Here is the full stack trace in the attachment
StackTrace.log

@wakaleo
Copy link
Member

wakaleo commented Jul 29, 2021

Could be an environment or firewall issue. Maybe ask the author of the repo you cloned, or see if you get the same issue with https://github.com/serenity-bdd/serenity-rest-starter/.

@anilemreciftci
Copy link
Author

Yea i get the same issue with https://github.com/serenity-bdd/serenity-rest-starter/ too. I changed maven, java even eclipse version but no chance still can't test status codes > 200 due to exceptions. Any advise?

@wakaleo wakaleo closed this as completed Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants