lightblue-platform / lightblue-client

GNU General Public License v3.0
5 stars 24 forks source link

Add support for passing result metadata, and updateIfCurrent flag #332

Closed bserdar closed 7 years ago

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 69.073% when pulling b22aeadbc787e5e3c79ce40e36354d0fc60d0f35 on bserdar:update-if-same into c9cad924d84b2da70b88ee4cbb0ea260e72de822 on lightblue-platform:master.

bserdar commented 7 years ago

It this client is used with older server, getResultMetadata will return null. The exception will only happen with a malformed response.

On Mon, Jan 30, 2017 at 11:20 AM, Marek notifications@github.com wrote:

@paterczm approved this pull request.

Looks good.

Could add an integration test where client interacts with Lightblue using update-if-current. Would be useful also as an example to link from documentation.

In core/src/main/java/com/redhat/lightblue/client/request/data/ DataSaveRequest.java https://github.com/lightblue-platform/lightblue-client/pull/332#pullrequestreview-19147240 :

@@ -41,7 +47,7 @@ public DataSaveRequest returns(List<? extends Projection> projection, Integer be return this; }

  • public DataSaveRequest returns(Projection... projection) {
  • public DataSaveRequest returns(Projection... projection) {

Whitespace introduced.

In core/src/main/java/com/redhat/lightblue/client/response/ DefaultLightblueDataResponse.java https://github.com/lightblue-platform/lightblue-client/pull/332#pullrequestreview-19147240 :

@@ -52,6 +52,25 @@ public int parseMatchCount() { return parseInt("matchCount"); }

  • /**
    • Returns a result metadata array where each element corresponds
    • to the metadata for the result at the same index in processed
    • array.
  • */
  • @Override
  • public ResultMetadata[] getResultMetadata() throws LightblueParseException {
  • JsonNode node=getJson().get("resultMetadata");
  • if(node instanceof ArrayNode) {
  • try {
  • return getMapper().readValue(node.traverse(),ResultMetadata[].class);
  • } catch (IOException e) {
  • throw new LightblueParseException("Error parsing lightblue response:"+getText()+"\n",e);

This will only happen when this client is used against older Lightblue server version (from before update if current) - right?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lightblue-platform/lightblue-client/pull/332#pullrequestreview-19147240, or mute the thread https://github.com/notifications/unsubscribe-auth/ADgDDbGRs0-xZPbljIx8Oylp3WW2pWZjks5rXin0gaJpZM4Lxuef .

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 69.073% when pulling c565d133530ffcc8f13d48f62060c673d33b9c6f on bserdar:update-if-same into c9cad924d84b2da70b88ee4cbb0ea260e72de822 on lightblue-platform:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 69.073% when pulling 47091e36c93f9a10d8409161052151d94d5a9aeb on bserdar:update-if-same into c9cad924d84b2da70b88ee4cbb0ea260e72de822 on lightblue-platform:master.