Skip to content

Rogatto/integration-automation-testing-example

Repository files navigation

Sample REST CRUD API with Spring Boot, Mysql, JPA and Hibernate

Using TestContainer to assure our Integration/API testing

Steps to Setup

1. Build and run the app using maven

mvn package
java -jar target/spring-boot-rest-api-tutorial-0.0.1-SNAPSHOT.jar

Alternatively, you can run the app without packaging it using -

mvn spring-boot:run

The app will start running at http://localhost:8080.

Explore Rest APIs

The app defines following CRUD APIs.

GET /api/v1/users

POST /api/v1/users

GET /api/v1/users/{userId}

PUT /api/v1/users/{userId}

DELETE /api/v1/users/{userId}

2. Execute test with code coverage Jacoco - * remember to start docker engine (the code coverage report will appear in target/site/jacoco)

mvn clean install

3. After execute the step 3 we can easily see the Allure report (to use Allure report is necessary to downloat it (Allure command line))

allure serve target/allure-results

allure-example

4. Postman collection -> API-USER.postman_collection.json

About

This repository contains examples using TestContainers in a Spring Boot Application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages