question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ending a state definition

See original GitHub issue

In pact-jvm-consumer-junit (and others?) there is currently no way to end a “given” definition, this makes it easy to accidentally place more requests that should’nt be in that state. One way around this is using states for all requests but I don’t think that should feel as forced as it currently is.

.given("mystate")
    .uponReceiving("post my request")
        .matchPath("/api/.+/.+/.+")
        .method("POST")
    .willRespondWith()
        .status(200)
        .body("string result")`
.endGiven()                       <---
    .uponReceiving...

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
solarmosaic-kflorencecommented, Aug 2, 2021

@uglyog confirmed:

{
  "consumer": {
    "name": "consumer"
  },
  "interactions": [
    {
      "description": "GET /hello-user",
      "request": {
        "method": "POST",
        "path": "/hello-user"
      },
      "response": {
        "body": {
          "hello": "user"
        },
        "status": 200
      }
    },
    {
      "description": "GET /hello",
      "providerStates": [
        {
          "name": "greeting",
          "params": {
            "name": "world"
          }
        }
      ],
      "request": {
        "method": "POST",
        "path": "/hello"
      },
      "response": {
        "body": {
          "hello": "world"
        },
        "status": 200
      }
    }
  ],
  "metadata": {
    "pact-jvm": {
      "version": "4.2.9"
    },
    "pactSpecification": {
      "version": "3.0.0"
    }
  },
  "provider": {
    "name": "example"
  }
}

I think this ticket can be closed.

0reactions
uglyogcommented, Aug 1, 2021

Released 4.1.24 and 4.2.9

Read more comments on GitHub >

github_iconTop Results From Across the Web

END STATE (noun) definition and synonyms
1. the situation reached at the end of a process; the final outcome. What matters in the Brexit negotiations is the end state...
Read more >
End-state Definition & Meaning
Define end-state. End-state as a noun means (military) The specified situation at the successful completion of the final phase of a military operation.....
Read more >
End state
end state. The set of required conditions that defines achievement of the commander's objectives. Dictionary of Military and Associated Terms. US Department of ......
Read more >
end state - definition and meaning
end state: The specified situation at the successful completion of the final phase of a military operation.
Read more >
end state Definition
end state means the state in the final stage of radioactive waste management in which the waste is passively safe and does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found