For building and running the application you need:
- Java Version 17.0+
- Maven 3
Lets first create a database in PostgreSQL server using the below command:
create database <database_name>;
We need to configure URL, username and password so that Spring can establish a connection with the database on startup. Add the above properties in application.properties file. (Modify <...> properties)
spring.datasource.url=jdbc:postgresql://localhost:<port>/<database_name>
spring.datasource.username = <USERNAME>
spring.datasource.password = <PASSWORD>
Run command:
./mvnw spring-boot:run
Run tests:
./mvnw test
To run especific test:
./mvnw test -Dtest="<test class name>"