Closed kpb closed 6 years ago
That's super interesting... Can you actually make the json smaller and try setting a field after a field to see what's wrong?
E.g. from
{
"start": "2018-03-09T00:01:32.656Z",
"stop": "2018-03-09T00:01:39.656Z",
"interval": 1000,
"elementSet": {
"satelliteNumber": 23670,
"elementNumber": 999,
"epochYear": 17,
"revolutionAtEpoch": 7885,
"epochDay": 99.51506375,
"firstDerivativeMeanMotion": -5.4E-7,
"secondDerivativeMeanMotion": 0.0,
"bstarDragTerm": 0.0,
"inclination": 0.18693348953485267,
"rightAscensionAscendingNode": 0.6581060650617457,
"eccentricity": 4.684E-4,
"argumentOfPerigee": 4.777837082005226,
"meanAnomaly": 5.53182280952528,
"meanMotion": 1.00248515,
"internationalDesignator": "95049A ",
"processed": true,
"committed": true,
"satelliteClassification": "U",
"typeOfEphemeris": "SGP"
}
}
to
{
"start": "2018-03-09T00:01:32.656Z",
"stop": "2018-03-09T00:01:39.656Z",
"interval": 1000,
"elementSet": {
"satelliteNumber": 23670
}
}
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Is there a way to modify this on the client side? The producer contract is used/shared elsewhere.
The wiremock stub is expecting the complete request and fails with a 404 if I remove parts of it.
@spencergibb, you can close it - but it's a showstopper bug for us. I was trying to be helpful.
I'll look into it.
BTW @kpb have you done what I asked you for?
That's super interesting... Can you actually make the json smaller and try setting a field after a field to see what's wrong?
Yes, but the client test fails when all the fields are not present, so I don't get any useful info.
So only when all fields are present do you get this exception?
I'll run it in a bit with fewer fields and comment with the error.
I don't think running the test with an incomplete request is useful.
When I run the client side test with:
{
"start": "2018-03-09T00:01:32.656Z"
}
I get:
ServerList:org.springframework.cloud.contract.stubrunner.spring.cloud.ribbon.StubRunnerRibbonServerList@1bea0289
2018-10-02 09:31:42.327 INFO 2598 --- [qtp575309252-27] / : RequestHandlerClass from context returned com.github.tomakehurst.wiremock.http.StubRequestHandler. Normalized mapped under returned 'null'
2018-10-02 09:31:42.413 INFO 2598 --- [qtp575309252-27] WireMock : Warning: JSON path expression '$.['elementSet'][?(@.['typeOfEphemeris'] == 'SGP')]' failed to match document '{"start":"2018-03-09T00:01:32.656Z","stop":null,"interval":0,"elementSet":null}' because of error 'Filter: [?] can not be applied to primitives. Current context is: null'
...
Request was not matched
=======================
-----------------------------------------------------------------------------------------------------------------------
| Closest stub | Request |
-----------------------------------------------------------------------------------------------------------------------
|
POST | POST
/ephemerides | /ephemerides
|
Content-Type [matches] : application/json.* | Content-Type: application/json;charset=UTF-8
|
$.['elementSet'][?(@.['typeOfEphemeris'] == 'SGP')] | {"start":"2018-03-09T00:01:32.656Z","stop":null,"interval<<<<< Body does not match
I asked you to run the producer side with incomplete results, build a stub and see when it will stop working.
That'll take a while. Another team 'owns' the producer and the stub is pushed to nexus and used by several other projects.
I'll have to set up a project to do this.
Sure, take your time.
Also I wonder if actually the output JSON Path is correct. What if, instead of a text file
{
"start": "2018-03-09T00:01:32.656Z",
"stop": "2018-03-09T00:01:39.656Z",
"interval": 1000,
"elementSet": {
"satelliteNumber": 23670,
"elementNumber": 999,
"epochYear": 17,
"revolutionAtEpoch": 7885,
"epochDay": 99.51506375,
"firstDerivativeMeanMotion": -5.4E-7,
"secondDerivativeMeanMotion": 0.0,
"bstarDragTerm": 0.0,
"inclination": 0.18693348953485267,
"rightAscensionAscendingNode": 0.6581060650617457,
"eccentricity": 4.684E-4,
"argumentOfPerigee": 4.777837082005226,
"meanAnomaly": 5.53182280952528,
"meanMotion": 1.00248515,
"internationalDesignator": "95049A ",
"processed": true,
"committed": true,
"satelliteClassification": "U",
"typeOfEphemeris": "SGP"
}
}
you will pass a Groovy Map
[
"start": "2018-03-09T00:01:32.656Z",
"stop": "2018-03-09T00:01:39.656Z",
"interval": 1000,
"elementSet": [
"satelliteNumber": 23670,
"elementNumber": 999,
"epochYear": 17,
"revolutionAtEpoch": 7885,
"epochDay": 99.51506375,
"firstDerivativeMeanMotion": -5.4E-7,
"secondDerivativeMeanMotion": 0.0,
"bstarDragTerm": 0.0,
"inclination": 0.18693348953485267,
"rightAscensionAscendingNode": 0.6581060650617457,
"eccentricity": 4.684E-4,
"argumentOfPerigee": 4.777837082005226,
"meanAnomaly": 5.53182280952528,
"meanMotion": 1.00248515,
"internationalDesignator": "95049A ",
"processed": true,
"committed": true,
"satelliteClassification": "U",
"typeOfEphemeris": "SGP"
]
]
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
Not sure If I'm doing something wrong here. I have a contract:
The json file looks like:
I publish my stub jars and on the client side, POST the same json request (file copied into consumer project). The test fails and here is the stdout:
The request is valid json, and the values are correct. Why does this test fail?