QArantanna#26 - How to create modular microservice test projects
The world is now full of distributed micro-services, generating different types of applications: the ones you are using to browse your social networks, to help professionals spend less time on repetitive tasks, and even to save lives.
We learned that testing the API layer with different approaches brings several benefits but also a complexity that can be measured in code duplication, high maintenance costs, and error-prone tests.
To solve this problem, in terms of how to test it, we can apply the same logic applied in microservices development: isolating them.
By creating a client and test projects for each microservice we can provide methods that other test projects can consume, easily enabling e2e tests creation.
During this presentation, I will show to you how we can create it from scratch or decompose an existing test project and a real success case of a company that delivers hundreds of microservices to its customers.
Testing microservices is a day-by-day activity for any team member and highly required to deliver bug-free services. Most software engineers create tests that can be seen only inside de microservice project, where others cannot be beneficial. Apply the approach proposed by this presentation will enable any team to use the test clients, speed up the testing process, and enable e2e tests.
Technologies in use
The knowledge acquired after this presentation can be applied with any programming language, however I will use the following technologies, in which I feel most comfortable: Java as the programming language with JUnit 5 to support the test creation supported by Maven. RestAssured as the library to test and validating REST services.
Software Engineers at any seniority level that wants to improve theirs distributes microservices test projects.
After this presentation the audience will be able to:
- Create test projects that are modular and reusable
- Create functional test for microservices
- Develop e2e microservices tests focusing on the business needs
- Implement a practical microservice test approach in your projects
Elias is an experienced IT professional with a background in software engineering, consulting, agile coach, and tech lead, currently working as Principal Engineer in Test at Backbase. He helps software engineers to develop their quality mindset and deliver bug-free software. His specialization in Quality Engineering for backend, frontend, and mobile technologies. He's a writer, blogger, and love to help the community by running meetups, sharing knowledge giving presentations around the world, and helping out.