Skip to content

Commit ed9d977

Browse files
committed
Added docker-compose and README.md
1 parent 26a8999 commit ed9d977

File tree

4 files changed

+83
-5
lines changed

4 files changed

+83
-5
lines changed

.github/workflows/main.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: CI Pipeline
22

3-
#on:
4-
# push:
5-
# branches:
6-
# - main
3+
on:
4+
push:
5+
branches:
6+
- main
77

88
jobs:
99
build:

README.md

+53-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,53 @@
1-
# qa
1+
2+
# Launching the QA Application Locally
3+
4+
## Prerequisites
5+
6+
- Docker
7+
## Introduction
8+
9+
The setup includes a MariaDB database and the application running with the `local` profile. This ensures that Liquibase can seed the database with the necessary tables.
10+
## Steps to Launch the Application
11+
12+
1. **Navigate to the Project Root Directory**
13+
14+
Open your terminal and navigate to the root directory of the project:
15+
```sh
16+
cd ~/qa
17+
```
18+
19+
2. **Run Docker Compose**
20+
21+
Execute the following command to start the application and MariaDB services:
22+
```sh
23+
docker-compose up
24+
```
25+
26+
> **Note:** The first time you run this command, it may fail with a "connection refused" error. This is expected due to the time it takes for MariaDB to initialize. Run the command again to successfully start the application.
27+
28+
3. **Accessing Swagger UI**
29+
30+
Once the application is up and running, you can access the Swagger UI at:
31+
```
32+
http://localhost:8090/swagger-ui/index.html
33+
```
34+
35+
## Generating Code Coverage Report
36+
37+
To generate the code coverage report, run the following Gradle command:
38+
```sh
39+
./gradlew codeCoverageReport --build-cache --no-daemon
40+
```
41+
42+
The report will be generated and can be viewed at:
43+
```
44+
~/qa/build/reports/jacoco/codeCoverageReport/html/index.html
45+
```
46+
47+
## BDD Tests
48+
49+
The BDD tests are located in the `application` module of the project.
50+
51+
## Conclusion
52+
53+
By following these steps, you should be able to launch the application locally, access the Swagger UI for API documentation, and generate code coverage reports.

docker-compose.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
services:
2+
mariadb:
3+
image: mariadb:latest
4+
environment:
5+
MYSQL_ROOT_PASSWORD: root
6+
MYSQL_DATABASE: blog
7+
MYSQL_USER: root
8+
MYSQL_PASSWORD: root
9+
ports:
10+
- "3306:3306"
11+
app:
12+
build:
13+
context: .
14+
dockerfile: Dockerfile
15+
environment:
16+
SPRING_PROFILES_ACTIVE: local
17+
ports:
18+
- "8090:8090"
19+
depends_on:
20+
- mariadb

spring-web/src/test/java/com/qa/blog/springweb/post/PostControllerTest.java

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ class PostControllerTest {
4242
@MockBean
4343
private FindPostById findPostById;
4444

45+
@MockBean
46+
private DeletePostById deletePostById;
47+
48+
@MockBean
49+
private SearchPosts searchPosts;
50+
4551
@MockBean
4652
private PostWebMapper postWebMapper;
4753

0 commit comments

Comments
 (0)