Make sure you have the following tools installed:
- Docker https://www.docker.com/get-started/
- Java 17
- Gradle 8
- junit 5 https://junit.org/junit5/
- RestAssured https://rest-assured.io/
- MockMvc https://docs.spring.io/spring-framework/reference/testing/spring-mvc-test-framework.html
- Testcontainers https://java.testcontainers.org/
- Wiremock https://wiremock.org/docs/junit-jupiter/
- Pull the latest Keycloak Docker image:
docker pull quay.io/keycloak/keycloak:latest- Start the Keycloak container:
docker run -d --name keycloak \
-e KEYCLOAK_ADMIN=admin \
-e KEYCLOAK_ADMIN_PASSWORD=admin \
-p 8080:8080 \
quay.io/keycloak/keycloak:latest start-dev- Access Keycloak at http://localhost:8080/ and log in using the credentials admin / admin.
- Access the Keycloak Admin Console at http://localhost:8080/.
- Select "Add Realm" and upload your realm-export.json file.
- Click "Create" to complete the import.
Follow these steps to run the Spring Boot application:
- Start Docker containers:
docker compose up- Run the Spring Boot application:
gradle bootRun- Access the API documentation in Swagger: http://localhost:8081/swagger-ui/index.html
- Access the UI: http://localhost:8081/users/manage
Execute the following command to run tests:
gradle clean test