Skip to content

Microservice Test Automation Example for SpringBootTest 2, JUnit 5, Cucumber 6, Selenium 4, Mockito 3, WireMock 2, Pact 4. All the testing frameworks are required to fully automate the testing for Microservices based Apps.

License

Notifications You must be signed in to change notification settings

MetaArivu/ms-test-quickstart

Repository files navigation

Order Microservice

Order Microservice is part of an eCommerce Application. The objective of selecting this Microservice is to demonstrate various testing frameworks. As Order is a complex service with internal (Ex. Inventory, Warhouse, Shipping etc) and external (Payment) service integration and it has all the requirements to use various testing frameworks. The objective is to demonstrate various testing frameworks.

Order Service REST Endpoints are documented using Open API v3. You can access the API's using http://localhost:9080/swagger-ui.html

Order Service API based on Open API v3

Order Service API based on Open API v3

Other Services

  1. Payment External Service
  2. Shipping Service
  3. Inventory Service
  4. Warehouse Service

Currently Order Service has a Mock Implementation of these services.

Now let us focus on Microservices Testing Strategies.

Microservice Testing Strategies

The following Test Categories helps you to automate the testing for Microservices based development resulting in ZERO End-2-End Testing. All the tests will be fully automated as part of your CI/CD pipeline.

Testing Categories for Microservices

  • Unit Testing (JUnit)
  • Component Testing (Cucumber + JUnit)
  • Behavior & Contract Testing (Mockito + JUnit)
  • Integration & Contract Testing (PACT & WireMock + JUnit)
  • UI Testing - User Flow (Selenium with Cucumber + JUnit)

Microservices Testing Categories

Dependencies

  • Spring Boot 2 (2.5.3)
  • Maven SureFire Plugin 2 (2.22.1)

Testing Frameworks

Microservices Testing Frameworks

  • SpringBootTest 2 (2.5.3)
  • JUnit 5 (5.7.2)
  • Hamcrest 2 (2.2)
  • Mockito 3 (3.11.2)
  • WireMock 2 ((2.29.0)
  • Cucumber 6 (6.10.4)
  • Selenium 4 (4.0.0)
  • Pact 4 (4.0.10)
  • AssertJ 3 (3.20.2)

Other Utility Libraries

  • Apache Commons (3.10)
  • Google GSON (2.8.7)
  • Google Guava (30.1.1-jre)
  • Faster XML (2.13.0-rc1)
/**
 * (C) Copyright 2021 Araf Karsh Hamid 
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

About

Microservice Test Automation Example for SpringBootTest 2, JUnit 5, Cucumber 6, Selenium 4, Mockito 3, WireMock 2, Pact 4. All the testing frameworks are required to fully automate the testing for Microservices based Apps.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published