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

Web API Server Core Endorsement - DecimalValue test fails with NullPointerException #156

Open
jeremiethibeault-centris opened this issue Apr 3, 2023 · 0 comments

Comments

@jeremiethibeault-centris

We're having a NullPointerException when executing the commander using our Web API RESO script file.

java.lang.AssertionError: ERROR: java.lang.NullPointerException
	at org.junit.Assert.fail(Assert.java:89)
	at org.reso.certification.stepdefs.WebAPIServerCore.lambda$new$19(WebAPIServerCore.java:445)
	at ?.Decimal data in "Parameter_DecimalField" "ne" "Parameter_DecimalValueLow"(file:///D:/a/r1/a/web-api-commander/src/main/java/org/reso/certification/features/web-api/web-api-server.core.feature:222)

The commander validates that the Web API supports filtering using decimal values using the following requests.

<Request
    RequestId="filter-decimal-eq"
    OutputFile="filter-decimal-eq.json"
    Url="*ClientSettings_WebAPIURI*/*Parameter_EndpointResource*?$top=*Parameter_TopCount*&amp;$select=*Parameter_KeyField*,*Parameter_DecimalField*&amp;$filter=*Parameter_DecimalField* eq *Parameter_DecimalValueLow*"
/>

...

<Request
    RequestId="filter-decimal-le"
    OutputFile="filter-decimal-le.json"
    Url="*ClientSettings_WebAPIURI*/*Parameter_EndpointResource*?$top=*Parameter_TopCount*&amp;$select=*Parameter_KeyField*,*Parameter_DecimalField*&amp;$filter=*Parameter_DecimalField* le *Parameter_DecimalValueHigh*"
/>

This is working fine except when one or multiple decimal values returned are null which is a valid result based on the given filter. In our case, there are no required decimal fields.

We can play around with the configurable sample values but in any case there could be null values returned in one of the eq or ne tests. This is not a problem for the gt, lt as null is filtered out.

<Parameter Name="DecimalValueLow" Value="1.00"/>
<Parameter Name="DecimalValueHigh" Value="1234567.89"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant