See the OpenApi 3 here.
In local env typing following url on browser for ui interface:
http://localhost:8080/swagger-ui/index.html
or that for yaml
version
http://localhost:8080/v3/api-docs/
- Java 17
- Spring Boot
- Spring Web
- Hibernate
- JPA
- docker
Under docker project folder typing :
docker-compose up --build
NOTE : before that compile
gpd
service withmvn clean package
command
If all right, eventually you'll see something like that:
gpd | 2022-01-27 13:49:00.772 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8085 (http) with context path ''
gpd | 2022-01-27 13:49:00.792 INFO 1 --- [ main] i.g.p.d.DebtPositionApplication : Started DebtPositionApplication in 9.591 seconds (JVM running for 10.458)
Under gpd
main project folder typing :
bash ./docker/run_local.sh
or
bash ./docker/run_docker.sh local
NOTE: above command run spring boot application via
mvn
command. You can comment this line and runs it with your favourite ide, to debug.
- git
- maven
- jdk-17
- docker
The easiest way to develop locally is start only db container and run spring-boot application.
/usr/local/bin/docker-compose up -d postgres
/usr/local/bin/docker-compose up -d flyway
mvn spring-boot:run -Dspring-boot.run.profiles=h2
For Spring Boot project:
- Add Flyway as a dependency in pom.xml
When this dependency added Spring Boot detects Flyway on the classpath and it will run it on startup. In this way, by default, flyway looks at files in the format V$X__$DESCRIPTION.sql (where $X is the migration version name) in the folder src/main/resources/db/migration. Example of the naming convention is: V001__INIT.sql
NOTE: In the application.properties the ddl-auto configuration must be validate. This causes Hibernate to validate the schema to see if it matches with what is defined in Java.
Under gpd
main project folder typing mvn clean verify
, if all right you'll see following stuffs
[INFO] Results:
[INFO]
[INFO] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ debt-position ---
[INFO] Building jar: /Users/pasqualespica/my_data/__TEMP/pagopa-debt-position/gpd/target/debt-position-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.6.2:repackage (repackage) @ debt-position ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
under main gpd
project folder typing
integration-test/run_integration_test.sh local
NOTE: suppose
Started DebtPositionApplication
on port8080
under main gpd
folder typing
bash api-test/run_test.sh l load
NOTE: suppose
Started DebtPositionApplication
on port8085
See CODEOWNERS
file