Skip to content

Unable to match predicate of path and value for grpc request #22

Description

@burigolucas

Hi there, first of all thanks a lot for this plugin to bring grpc to mountebank. Hopefully you are still maintaining this project and could help to sort out an issue related to matching precicates for the grpc request. I have posted the original question on stackoverflow. Below is the question replicated for documenting it here in the project:

I am using the grpc plugin to create stubs for grpc requests. It works very well when matching the path only. However, I am facing issues to match both the path and the value. In particular, I am using the jsonpath to select the fields to match. Here is a sample o the request:

{
  "path": "/service.DataProvider/ReadData",
  "value": {
    "identifiers": [
      {
        "unique_id": "unset",
        "data_id": "point1",
        "system_id": "mock"
      }
    ],
    "start_time": {
      "seconds": "1650431509",
      "nanos": 0
    },
    "end_time": {
      "seconds": "1650431569",
      "nanos": 0
    }
  }
}

and the predicates:

        "predicates": [
        {
            "deepEquals": {
              "path": "/service.DataProvider/ReadData"
            }
          },
          {
            "jsonpath": {
              "selector": "$.identifiers[0].data_id"
            },
            "deepEquals": {
              "value": "point1"
            }
          },
          {
            "jsonpath": {
              "selector": "$.identifiers[0].system_id"
            },
            "deepEquals": {
              "value": "mock"
            }
          }
        ]

Any idea of what is wrong on the predicates above? Any comments will be highly appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions