Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Api Specification for integration testing #25

Merged
merged 5 commits into from
Feb 29, 2024
Merged

Conversation

oskardudycz
Copy link
Collaborator

@oskardudycz oskardudycz commented Feb 24, 2024

In Emmett, you get lightweight abstractions like event store, command handlers, etc. Event Sourcing gives repeatable patterns for handling business logic:

  1. Read events and build the state.
  2. Take that state and a command and run business logic.
  3. Store new event(s) as a result.

That's super easy to test, especially in the BDD style:

  1. Given a set of events.
  2. When the command is run.
  3. Check the result events.

Now, I had a thought: why not apply the same for API tests? Such tests could even be written in the Hexagonal Architecture style by replacing the external dependencies with some in-memory implementation or just going fully end-to-end.

The benefit of that is that you can test the whole pipeline (middleware, auth, etc.), even Open Telemetry traces (like Martin Thwaites showed in his talks).

This PR introduces the first version of such tests.

@oskardudycz oskardudycz force-pushed the integration_tests branch 2 times, most recently from 0625efb to f18c721 Compare February 24, 2024 18:33
@oskardudycz oskardudycz changed the title Added Api Specification Added Api Specification for integration testing Feb 26, 2024
@oskardudycz oskardudycz marked this pull request as ready for review February 29, 2024 08:33
@oskardudycz oskardudycz merged commit aa4413f into main Feb 29, 2024
1 check passed
@oskardudycz oskardudycz deleted the integration_tests branch February 29, 2024 08:51
@oskardudycz oskardudycz added this to the 0.3.0 milestone Feb 29, 2024
@oskardudycz oskardudycz added the enhancement New feature or request label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing WebApi
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant