Search code examples
akkaintegration-testingakka-http

Framework for E2E tests akka-http


Asking this question because I am trying to figure out the framework which is most widely used for integration testing akka-http. How to automate those tests in Jenkins? Probably a rookie question but ideas are appreciated. Thanks

EDIT from comments: What have you tried so far? So far I tried implementing 1. Jest 2. Using Testkit, IntegrationPatience Where are you stuck? Both the approaches doesn't look like standard to me and since I have app deployed in multiple locations, I am trying to understand if there is any framework out there which I can use to setup. The app is deployed to multiple data centers which may have different environment variables.


Solution

  • There are a bunch of ways to test a microservice developed using akka-http:

    1. Unit testing
    2. Functional / Integration testing
    3. E2E testing
    4. Load testing

    Unit testing using route-testkit (https://doc.akka.io/docs/akka-http/current/routing-dsl/testkit.html)

    Functional testing & E2E testing using Akka HTTP client API (https://doc.akka.io/docs/akka-http/current/client-side/index.html) with API contracts you can validate the status codes and response body.

    Load testing can be achieved using a bunch of tools, specifically in Scala you can take a look at Gatling.