java.lang.NullPointerException: Cannot get property 'assertionClosure' on null object
See original GitHub issueI get this exception (java.lang.NullPointerException: Cannot get property ‘assertionClosure’ on null object) when using the RequestSpecificationBuilder as below and sending a request using POST method
//Elsehwere
RequestSpecification r = RestAssured.given().relaxedHTTPSValidation().accept(ContentType.ANY)
.auth().preemptive().basic(cslConsole.getloginUser(), cslConsole.getloginPassword())
.baseUri(cslConsole.getManagementConsoleURL());
basicRequest.spec(r);
//At the point of sending the request
RequestSpecBuilder builder = new RequestSpecBuilder();
builder.addRequestSpecification(basicRequest);
builder.addQueryParam("param","50");
builder.setBasePath("/api/v1/scsr");
builder.setBody("Some body");
RequestSpecification request = reqSpecbuilder.build();
String url = "https://10.0.2.4:8443/"
Response response = request.post(url); ---->exception
Is this expected ? I do not see an issue with the RequestSpecBuilder .setBody() as I am using it with only POST? Any clues ?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Null-pointer exception when invoking get in rest-assured
Try using RestAssured.given() to call your GET. You can use your requestSpec by doing something like this:
Read more >Solved: How to fix "cannot get property 'info' on null obj...
When trying to create my first project by importing from my swagger (Apoen API 2.0) spec, it fails with "java.lang.NullPointerException: cannot ...
Read more >Cannot get property 'assertionClosure' on null object
I get this exception (java.lang.NullPointerException: Cannot get property 'assertionClosure' on null object) when using the ...
Read more >Nullpointer: Cannot get property 'stages' on null object
java.lang.NullPointerException: Cannot get property 'stages' on null object at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60) at ...
Read more >Cannot Get Property "Name" On Null Object - Oracle Support
My Oracle Support Banner. Cannot Get Property "Name" On Null Object (Doc ID 2636751.1). Last updated on JULY 01, 2021 ... Java.lang null...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Pass your built RequestSpecification instance to the given method…
RestAssured.given(spec).get();
Yeah sounds like a bug 😦
On Wed, Dec 6, 2017 at 10:39 PM, dreamsivaraj notifications@github.com wrote: