Discussion: Test containers or test doubles (comparison inside)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davidbrok5
    New Member
    • Jan 2020
    • 3

    Discussion: Test containers or test doubles (comparison inside)

    When testing flows that start with a message from a queue, or ends by publishing a message to the queue, would you prefer testing against a real server (e.g. using test containers) or stub the MQ client (e.g. using mockito)?

    I started to craft a comparison table between the two, could be nice to discusss the trade-off
    Last edited by Niheel; Feb 21 '21, 12:33 AM.
  • dreamtext
    Recognized Expert New Member
    • Feb 2021
    • 24

    #2
    Depends on the use case right?

    Running your test against real servers make more sense if the code is being shipped in a live service and there are enough resources to run the containers for running tests.

    It's still an automated test that runs against a more production like environment
    Testcontainers is an opensource library for providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.


    Mocktio is great for testing code when shipping code that you might be selling or open sourcing where you don't know how the end user will use the code and you just want to make sure everything works on each release.

    Comment

    Working...