The purpose of this repo is to serve as a reference when deciding what test levels to use to test a microservice.
The following testing levels can be observed:
- Unit Test | POJO | JUnit
- Unit Test | Spring Beans | Mocking Dependencies | Mockito
- Integration Test | Rest Controller - HTTP | MockMvc
- Integration Test | Persistence Layer - DB | JpaTest
- Component Test | Service | Cucumber and RestAssured
- End-to-End Test | Service | Cucumber, RestAssured and Selenium
Steps to create the Docker image and run the container:
mvn clean package
- to package and create the jar filedocker build -t sample-sut4test .
- to build the Docker imagedocker run -d -p 8081:8081 sample-sut4test
- to run the Docker containerhttp://localhost:8081/ui/v1/employees
- to check the application is running correctly
sequenceDiagram
Alice ->> Bob: Hello Bob, how are you?
Bob -->> John: How about you John?
Bob --x Alice: I am good thanks!
Bob -x John: I am good thanks!
Note right of John: Bob thinks a long<br/>long time, so long<br/>that the text does<br/>not fit on a row.
Bob --> Alice: Checking with John...
Alice -> John: Yes... John, how are you?