https://github.com/luisboto/hexagonalspring
💠Simple multimodule Maven/Spring project exposing an endpoint using hexagonal architecture.
https://github.com/luisboto/hexagonalspring
e2e-testing hexagonal-architecture integration-testing jpa jpa-hibernate maven mockito-junit-test multimodule-maven spring spring-boot
Last synced: 8 months ago
JSON representation
💠Simple multimodule Maven/Spring project exposing an endpoint using hexagonal architecture.
- Host: GitHub
- URL: https://github.com/luisboto/hexagonalspring
- Owner: LuisBoto
- License: apache-2.0
- Created: 2023-10-19T13:30:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-25T13:34:43.000Z (over 2 years ago)
- Last Synced: 2025-03-18T05:18:37.496Z (about 1 year ago)
- Topics: e2e-testing, hexagonal-architecture, integration-testing, jpa, jpa-hibernate, maven, mockito-junit-test, multimodule-maven, spring, spring-boot
- Language: Java
- Homepage:
- Size: 198 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HexagonalSpring
Simple Spring multimodule Maven project exposing an endpoint using hexagonal architecture.
## Compiling and Running
To run the project right out of the box, navigate to the *hexagonalApplication/* module folder and run:
```
mvn spring-boot:run
```
Otherwise, using the included maven wrapper, run the following command to generate a JAR file:
```
./mvnw clean package
```
After this, there should be a compiled .jar file within the startup module's target folder:
```
java -jar ./hexagonalApplication/target/hexagonalApplication-0.0.1.jar
```
## Project structure:
The parent pom declares 4 modules: **inbound**, **outbound**, **core**, and the **hexagonalApplication** module. This last one contains the main class, e2e tests, and dependencies to the other modules just so that everything is propertly scanned and loaded upon startup. The core module does not depend on anything.
The inbound module contains the REST API controller layers and config, and the outbound module contains the persistence layer and JPA implementations. Through a dependency inversion against the core module, this last one consists exclusively of the business and service logic.
The final module structure is the following:
## Testing
This project includes configured, ready to run e2e and integration testing dependencies.
The core, inbound, and outbound modules all contain some minor **unitary tests** using **Mockito**.
The startup **hexagonalApplication** module contains **e2e tests** using **RestAssured**; and the **outbound** module also contains provider **integration tests** against the embedded H2 database.