DSL for Http Server to assert on Webhooks and similar
See original GitHub issueI want to test that my API is calling webhooks, and that it is sending the data as specified. Currently, I need to write my own HTTP server that saves and returns the data, so I can assert it. It would be awesome to have this integrated in Cornichon.
Here’s an example with a made-up DSL:
// Create the HTTP server that listens for webhooks
When I httpListenTo("http://localhost:12345/webhook")
// Do something that should trigger the webhook
When I post("/users").withBody(
"""
{
"firstname": "Foo",
"lastname": "Bar"
}
""")
Then assert status.is(201)
// Check that webhook was delivered
Then assert httpListen.received_calls(1)
And assert httpListen.lastBody.is(...)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
How to Build a Webhook System in Rails Using Sidekiq
It's going to accept a webhook ID as an input parameter, use that to query the endpoint, then POST the event payload to...
Read more >Verifying whether specific HTTP requests were made | WireMock
Verifying and querying requests relies on the request journal, which is an in-memory log of received requests. This can be disabled for load...
Read more >HTTP - Apache Camel
Send requests to external HTTP servers using Apache HTTP Client 4.x. ... Configuring components can be done with the Component DSL, in a...
Read more >Testing Webhooks with JS - Assert.This
The post route accepts incoming webhook requests and responds with our default status code. The webhook request is destructured so we can ...
Read more >checkr/openmock: Mock all the services. Intuitive ... - GitHub
Intuitive YAML DSL for HTTP, gRPC, Kafka, and AMQP mocks. - GitHub - checkr/openmock: Mock ... Used in Makefile during swagger admin API...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here is what I believe I can propose for a start.
Design points:
WDYT?
first public version shipped in 0.9.3 + minimal doc available in Readme.