- Java 23 should be installed -->
export JAVA_HOME=$(/usr/libexec/java_home -v 23)
- Maven should be installed
- Docker should be installed
- Postman can be installed
- Run
mvn test
ormvn clean install
ormvn clean package
or./mvnw clean install
command to run all the tests mvn spring-boot:run
- Import the followings to test in Postman
- Swagger: http://localhost:9000/swagger-ui/index.html
- Click
Authorize
and enter the following credentials client_id
:client
client_secret
:secret
- Use one of the following default values to log in http://localhost:9000/login
- username:
Developer
password:password
- username:
Admin
password:password
- username:
User
password:password
- username:
- Click
- Database credentials
url
:jdbc:mariadb://localhost:3306/oauth2_authorization_server
username
:mb_test
password
:test
- A quick guide on how to run Spring Boot tests in debug mode using IntelliJ IDEA's terminal.
- Run one of the below commands in the terminal
mvn test -Dmaven.surefire.debug
- If port 5005 is already in use, you can specify a custom port
mvn test -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
- Open IntelliJ IDEA
- Go to
Run > Attach to Process
(or use shortcut)- Windows/Linux:
Ctrl + Alt + 5
- Mac:
Cmd + Alt + 5
- Windows/Linux:
- Select the Java process running your tests
- The test will pause until you connect your debugger. Once connected, you can use breakpoints and step through your code.