Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xpinjection/test-driven-spring-boot
Sample project for "Test-driven Spring Boot applications" training.
https://github.com/xpinjection/test-driven-spring-boot
database dbunit java mocking mockito spring spring-boot tdd web
Last synced: about 12 hours ago
JSON representation
Sample project for "Test-driven Spring Boot applications" training.
- Host: GitHub
- URL: https://github.com/xpinjection/test-driven-spring-boot
- Owner: xpinjection
- Created: 2017-07-11T19:37:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-26T15:53:08.000Z (9 months ago)
- Last Synced: 2025-01-03T10:09:46.720Z (8 days ago)
- Topics: database, dbunit, java, mocking, mockito, spring, spring-boot, tdd, web
- Language: Java
- Homepage: http://xpinjection.com/trainings/test-driven-spring-boot-applications/
- Size: 252 KB
- Stars: 109
- Watchers: 9
- Forks: 84
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Library application
![CI status](https://github.com/xpinjection/test-driven-spring-boot/actions/workflows/maven.yml/badge.svg)
Sample Spring Boot cloud-native application written in TDD style.
## Local run
The easiest way to run application locally is to use _LocalLibraryApplication_ class. It will run all needed dependencies in the Docker containers and configure application to use them automatically.
## Configuration
To enable Actuator endpoints admin profile has to be activated with proper secrets provided via system properties or other suitable external configuration option:
> _-Dspring.security.user.name=admin -Dspring.security.user.password=xpinjection -Dspring.profiles.active=dev,admin_
## Consumer-driven contracts
[Pact](https://docs.pact.io/) is used to describe and manage REST API contracts.
Sample instance of the Pact Broker in Docker could be started with `/pact/docker-compose.yaml`. It starts the Pact Broker and the PostgreSQL database as dependency. Data is not stored on volumes, so will be cleaned after restart.
Pact integration could be enabled during tests execution with `pactbroker.enabled` system property.
Use system variable `pact.verifier.publishResults` to control pact verification results publishing to the Pact Broker. Pact Broker configuration is located in `pom.xml` and could be overridden with system properties as well.
System properties `pact.provider.version` and `pact.provider.branch` should be used to pass correct version of the application and git branch for tracking in the Pact Broker.