lundi 1 février 2016

How to test a microservice by mocking the dependencies?

I've a RESTFul microservice written in Grails. This microservice has it's own DB. It also depends on two other microservices.

A typical workflow of the service is:

  1. Receives a GET request from a client e.g. browser
  2. Calls another microservice throw http to get some information
  3. Queries it's own DB to get some data
  4. Send a response to the client

I want to write automated tests for this service. Whenever I'll run the test, it'll do the following:

  • Mock the external microservices
  • Create a database and populate it with test data
  • Run the application and configure it to use the mock services and DB
  • Run the test cases by sending http requests and matching responses

Here are my questions:

  • What type of test is this?
  • What are some good frameworks or tools to write this type of test?

I'm not a QA so may be I'm asking stupid questions.

Aucun commentaire:

Enregistrer un commentaire