passing null value as parameter throws "java.lang.IllegalArgumentException"
See original GitHub issueI’ve requirement to check null value for a parameter and this is how I’m passing it
given().
contentType("application/json").
pathParam("NI", 3000).
pathParam("DP", null).
but this code throws error
java.lang.IllegalArgumentException: parameterValue cannot be null
related issue https://github.com/rest-assured/rest-assured/issues/631
Issue Analytics
- State:
- Created 6 years ago
- Comments:11
Top Results From Across the Web
IllegalArgumentException or NullPointerException for a null ...
If a caller passes null in some parameter for which null values are prohibited, convention dictates that NullPointerException be thrown rather than ...
Read more >IllegalArgumentException or NullPointerException ... - Baeldung
When we read the Javadoc for IllegalArgumentException, it says it's for use when an illegal or inappropriate value is passed to a method....
Read more >[Solved] java.lang.IllegalArgumentException in Java
For example, if the method requires a non-empty String as a parameter but we pass the input string as null then the java.lang.IllegalArgumentException...
Read more >Can not pass null value to the argument when us... - JBoss.org
We have EJB functions where some values passed in can be null but when we ... IllegalArgumentException: null 'value' arg in method call....
Read more >ArgumentNullException - Agi
The exception that is thrown when a null reference is passed to a method that does not accept it as a valid argument....
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
Like you just did, don’t use
pathParam
when you meanqueryParam
. Also"null"
is a string, you probably want to use an empty string (“”) or no value at all (e.g.queryParam("downPayment")
)What do you mean by “check null value”? You cannot pass “null” as a path parameter. It doesn’t make sense, perhaps you mean an empty string?