question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"When method post" throws NullPointerException

See original GitHub issue

This works fine

Feature: Intelligence

  Scenario: Creates a new model

    Given url urlBase + '/model'
    When method get
    Then status 200
    And match response == { success: true, result: '#notnull' }

But when I change the method to post

Feature: Intelligence

  Scenario: Creates a new model

    Given url urlBase + '/model'
    When method post
    Then status 200
    And match response == { success: true, result: '#notnull' }

I get this NullPointerException

java.lang.NullPointerException
	at com.intuit.karate.StepDefs.method(StepDefs.java:197)
	at ✽.When method post(intelligence/intelligence.feature:6)

I’m able to make POST requests to the endpoint via PostMan just fine

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ejfranciscommented, Feb 17, 2017

@ptrthomas yup that works fine, thanks for the clarification

0reactions
ptrthomascommented, Jan 9, 2020

@palakjainq sorry I’m not going to read all of this. please follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

"When method post" throws NullPointerException #5 - GitHub
This works fine Feature: Intelligence Scenario: Creates a new model Given url urlBase + '/model' When method get Then status 200 And match ......
Read more >
Why do i get NullPointerException when i try to create object ...
Actor object in the tests is properly initialized, it all should have worked fine. Here is the post method : @POST @UnitOfWork public...
Read more >
How to Fix and Avoid NullPointerException in Java - Rollbar
The NullPointerException occurs due to a situation in application code where an uninitialized object is attempted to be accessed or modified.
Read more >
Java NullPointerException - Detect, Fix, and Best Practices
The NullPointerException can occur if the argument is being passed as null. The same method can be written as below to avoid  ......
Read more >
java.lang.NullPointerException for CompanyInfo POST query
Hi,. I'm using Node.js client(https://github.com/intuit/oauth-jsclient), and try to get data using Post query. But I got java.lang.NullPointerException like ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found