Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abhishekomp/post-service
Spring Boot Rest Api with TestContainer(PostgreSQL, H2) for Integration Testing
https://github.com/abhishekomp/post-service
h2-database integration-testing mockmvc postgresql-database spring-profiles testcontainer testcontainers
Last synced: 7 days ago
JSON representation
Spring Boot Rest Api with TestContainer(PostgreSQL, H2) for Integration Testing
- Host: GitHub
- URL: https://github.com/abhishekomp/post-service
- Owner: abhishekomp
- Created: 2024-09-03T17:30:56.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-10-03T12:14:49.000Z (4 months ago)
- Last Synced: 2024-11-26T05:07:51.413Z (2 months ago)
- Topics: h2-database, integration-testing, mockmvc, postgresql-database, spring-profiles, testcontainer, testcontainers
- Language: Java
- Homepage:
- Size: 52.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring Boot Rest API
## Start the app
### Using maven command
Navigate to the project directory and run:
`mvn spring-boot:run`Specify Profile:
`mvn spring-boot:run -Dspring-boot.run.profiles=h2`
`mvn spring-boot:run -Dspring-boot.run.profiles=postgres`### Using java command
- Make sure to run mvn clean package so that jar file is available.
`java -Dspring.profiles.active=h2 -jar ./target/*.jar`### Using mvnw command (is basically the same as using the mvn command)
`./mvnw clean package -DskipTests`
`./mvnw spring-boot:run -Dspring-boot.run.profiles=h2`## Serving static resources (html, external css, and image inside html)
My example (external css + image): http://localhost:8080/html_with_external_css_and_image.html
Basic html: http://localhost:8080/test.html
Basic html: http://localhost:8080/testB.html